From patchwork Wed Oct 12 14:55:37 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: 9373353 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 258DC60487 for ; Wed, 12 Oct 2016 14:56:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14ABE267EC for ; Wed, 12 Oct 2016 14:56:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08F592956C; Wed, 12 Oct 2016 14:56:17 +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 AB399267EC for ; Wed, 12 Oct 2016 14:56:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933778AbcJLOzu (ORCPT ); Wed, 12 Oct 2016 10:55:50 -0400 Received: from mout.web.de ([212.227.15.14]:52442 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932826AbcJLOzt (ORCPT ); Wed, 12 Oct 2016 10:55:49 -0400 Received: from [192.168.1.2] ([78.49.9.22]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LseoD-1asuVn2Sld-012DLW; Wed, 12 Oct 2016 16:55:38 +0200 Subject: [PATCH 17/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_enum_input() To: linux-media@vger.kernel.org, Hans Verkuil , "Lad, Prabhakar" , Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <88b3de4c-5f3f-9f70-736b-039dca6b8a2e@users.sourceforge.net> Date: Wed, 12 Oct 2016 16:55:37 +0200 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: X-Provags-ID: V03:K0:x0RbpPKYdmPd3Pt+sttIKGwYVqbWfbmJyXk1mpZBJHb+pGeEehq Q7D4rdU6jucfcxYhiX6h00OeHTY/+j+1n/wSRE+l9EhAy0VocvJukvqNmsBm56dF9uvVsLe Vk6EqrWERD0ofmH8DsdUxG3I8eP1B8Mvvtw5ccaDOBFRHTLpNMmedv4LW3aln5++0issXhh LAACfQYQdmOC3XirZ152w== X-UI-Out-Filterresults: notjunk:1; V01:K0:ffDnabibeng=:FL2zuBXJjFlrQ+lqOfMgVO SpuomyzKYCsGlgFWFn1mHI/xugsE4LCpPzBLob2pd8ODP/amq3plRMttNF4RlgZn/OSBNBNiV HGR0NFQNfoxl1+pQ1LiFfMtx9DFRNBRyscXzJHUf7lAlKTIHnYd+TkvXN/ya2L78QvVELnUNG Q3vjmFJkWqPJKcyeNMJSRtXZtMv5n8/HXhCriMYVSzc2/axN1yWEIWVkHxl7yR+gHMomNM4oM drNe19yzsURDR4G8+PsGc535dzV2aLtEcVsrTpRhY78jfJnSespZtWZ4Vef+i/DyDWKHTmyey Q2DNssv6WT3i6cqXrq8pJTim6tDyT5k72dHG0rzoYSt+lMJHBdUT8hCPy8/GMaPN4z8gx0C0s dfI6IWG28CxsppTn6n8NDQUWmns8kBeLwrrPybRVKYZ6QHQ/C8feCNijJvVy6cmfbRlOTgw9f TLQQ3ABTX+fhYTQhE5WQQOBhzAc/v8Np/WnHpHwK5tqpS2KhSbPQTKGppwpwdkUz6SR8wpFDZ xAwoP07nUuhwTRqUOPWjozX5pnt4TCzsSEMyWtqlFy7xpro/l9p0VUVmQirVBdpSrywhBNK0m ljf825y1e9dnrPErOGzWKW8EzC8e0YZGvOSHGkemlf6TsOad1dYqwfsBxtqKf6/InPoratpfW 9HGAuvRZN8OfZ8uFD7qjleM7YEo5rePwG7ZR28uA5Lu5nXGgwwWuEK1VQe2JgUxD4sdYawQ0+ k8lqU+qLwBs6SkeXthDkiEeRMM0qn2DbPAjC5kkDlmDwRTL4IKYDYu6Rfl9usCX+4r604W4MV dj0oPvC 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: Wed, 12 Oct 2016 10:33:42 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. 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..87ee35d 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)); + memcpy(inp, &sdinfo->inputs[index], sizeof(*inp)); return 0; }