From patchwork Sun Nov 6 21:00:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9414097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEA7060515 for ; Sun, 6 Nov 2016 21:01:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF1A328E16 for ; Sun, 6 Nov 2016 21:01:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3B3B28E3C; Sun, 6 Nov 2016 21:01:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1B128E16 for ; Sun, 6 Nov 2016 21:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750920AbcKFVBK (ORCPT ); Sun, 6 Nov 2016 16:01:10 -0500 Received: from mout.web.de ([212.227.15.4]:57706 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbcKFVBJ (ORCPT ); Sun, 6 Nov 2016 16:01:09 -0500 Received: from [192.168.1.2] ([77.181.50.2]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0M5wkL-1cnJzK2h0z-00xoQU; Sun, 06 Nov 2016 22:00:55 +0100 Subject: [PATCH v2 17/34] [media] DaVinci-VPFE-Capture: Replace a memcpy() call by an assignment in vpfe_enum_input() To: Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab , linux-media@vger.kernel.org References: <88b3de4c-5f3f-9f70-736b-039dca6b8a2e@users.sourceforge.net> <6a3a4a79-d428-f5d9-87e0-97fd91b75c2a@users.sourceforge.net> <3c76f5d0-4469-01a4-3a7c-49401aeb84b7@xs4all.nl> Cc: Hans Verkuil , LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <57b1ce94-7b3c-99e2-e02e-1784cb0eef0f@users.sourceforge.net> Date: Sun, 6 Nov 2016 22:00:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <3c76f5d0-4469-01a4-3a7c-49401aeb84b7@xs4all.nl> X-Provags-ID: V03:K0:OyyPBT6w22QVkIlB6rizshX+B77KQFO5v2qYRlJ3OuZF8ICt2I7 zl2EtAN0oJZlo+t2uKGL8UGAavovwlA/GZl2A+sBZN2v4gg92EE31HdWyRWNNqvZw4riLVi 2yoW8VW33s5kjD31eIYPpWax8fMK45pG4JF0y17Wle3aSlnSismaLzSh+QkmkKZ3Xn/bRlC ZV3t0iqaL4nQkNpf95CVQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:xUX0cHOQl4g=:hOorlzSr1pv7N7WSb8BS7v LpaCO4nZGCSXSEEXxQIw5SY8uFogPc/876oqoZaHO1HkAraefJlI62YYaHGHmeATjCTFB0NAv yjtIaRa/5+HJXVhUXn8ksjo4QYO4yCdZkVhSAVYWq3vHTDLBroSd6j7GEGkiRKpraId+n1gWz 5IowznsWuLjN2bVpaR1MtCgIBNlPt7JvWrKGmE3JnJiwnq6X92i42bJbPWVNdBrkiEg5wuGRl ZqwjXpSsx9vQOXkCi1qC+pc2TI4CjllVMxGdPHsJ7kt4EYSgrVj9HXj4UQkpMEVmMNdzBEFkO 2uUn+SGmeT/0gvZf5XSgF/nfrGKU6ZJHJS19vz6Qkp1S4oKo39h4JOgs86iGNuKgwjQtiLBt7 qXpLt7UploCUzAf2PhP1AHNLIDh6wTfAOJGrjhdVXh+K+7VcVy8y7LosnLg0UlLiGmyFkV/yn 1aJyYpT23XfPAj5W9dHdGFKc/OU0Rfaf14F9wfIGpLll/YJBSwlou4Dw/3nYFWLH5OZJaJHvL XOQ5m1TyJr7IKcHJeWOfEKiQ6epTZ/tMAdbvU5BW68yO8ho1MEjrzq3gm8/Ib+OkPXnkGM0Pm T8mwxCHemLXI7xWjLKlq+R3un08qUT16eMcx7q0Fk9HnH8w+5w6EjmWm4tkHpjU1LWF5QRvu7 g45U8wx0G1CtRRh8uP0uLBIZdiEJ+J4aqIIJLD5ePY4itgklB1fWfKIoPTeeli+JVySpBV1rv 6OJ/9R88+Ta8XjI4yoE18WfXt54/KSyrzQKZLFwoSqd2t8BhY3ZczKnjoe+SwEaiiq2XkS6wd A9wxXjn Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 6 Nov 2016 21:54:38 +0100 Use a direct assignment for an array element which can be set over the pointer variable "inp" instead of calling the function "memcpy" here. Suggested-by: Hans Verkuil Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpfe_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 8314c39..5417f6b 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1091,7 +1091,7 @@ static int vpfe_enum_input(struct file *file, void *priv, return -EINVAL; } sdinfo = &vpfe_dev->cfg->sub_devs[subdev]; - memcpy(inp, &sdinfo->inputs[index], sizeof(struct v4l2_input)); + *inp = sdinfo->inputs[index]; return 0; }