From patchwork Sun Sep 17 06:58:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9954619 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 09892603F2 for ; Sun, 17 Sep 2017 06:59:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F09DC28BD8 for ; Sun, 17 Sep 2017 06:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7E1328BE0; Sun, 17 Sep 2017 06:59:29 +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=unavailable 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 9CD8E28BDC for ; Sun, 17 Sep 2017 06:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750995AbdIQG7C (ORCPT ); Sun, 17 Sep 2017 02:59:02 -0400 Received: from mout.web.de ([217.72.192.78]:61571 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbdIQG7B (ORCPT ); Sun, 17 Sep 2017 02:59:01 -0400 Received: from [192.168.1.2] ([77.181.201.34]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lrruc-1dPSS72Q2Q-013gMh; Sun, 17 Sep 2017 08:58:49 +0200 Subject: [PATCH 2/2] [media] si2157: Improve a size determination in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Antti Palosaari , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <87f4a386-ac11-87f5-2d22-7bfc0593de34@users.sourceforge.net> Message-ID: Date: Sun, 17 Sep 2017 08:58:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <87f4a386-ac11-87f5-2d22-7bfc0593de34@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:25b/UDDlB5TM6pEV+mFHosUtswRxN9IUz4PBIkfyHBt3TRLNihq blxxeeIpQ4vGIru1AjvL0VmN5pMvQ9RUi+eVIoTsdOCq1SvBmq0q6uaHtXtkh31HZ1sWHlD US7wRrxidgVVS3SdIu/GAHmmZ1X5kVCJ95EawFy3L3FDr+USZG/eta8Z029LLy1g5pdIV6C ypscaufBEU5OJWy2C9Iuw== X-UI-Out-Filterresults: notjunk:1; V01:K0:UZWeFPKpstk=:VOB73GAHaSfKsncmzCbez+ dR4GFvmIPev4m6xJTzel9OJ8hVdCB3ACrdSx/Y0yfZIK/y+JSuHWFD8zW0JOfjwgP6+i/zpmP y3vbX4JxFaXCJkBiQT17P2tdOOE95f7/qHMsotS4s3+RqETOwi6TPAtqo1gJZ9P5bCgzj4L45 lvmIH482n0/9V9SS01yrlWWNaOT3PB7EF9jBGXN91uMd+G5Ni8nVXgQvM4+RRdrPwcb697uvO atQCKBX23igDcC1L3qszMQLRGFQE3yWJXSVv/A7OIo37OlYy331BrUudG09cHtZnWWUpEkDrR ja6H0B5+mMMtujjh9YvDkr9dZ8Tjs6EWS5tcgOEgvc7OzMXL53tnhgr7B20aYFkZtXsaGN2Mg N3YUSEzQpVws0nygda/7Kb0qgtnRZx93y1kHtBWLD9fr6r8mHRXznscT4R6X8DI0TPWzHxPev i6LYVLygbou9mIZ8frJXC57JKfak1fto2AJ7fCRN7xQv9sQs1WArLRtKYAA5y69WrB/9sd7qp T7WGzoQPFmP+OlbM8TjuDt/DEuZdfaGrxkzk6qULoTt+yzKi1azKcVx6lM2O5eSEs+A8RW4YH MfPYnFChNPcEG4n/9FRAjrdSdozCBnfyaVUULTNXDkjQBUgPCOqVaVBiw2KEjb5DdVg5Wtk5X u6ymmo2J8lQ5amxTrXOn6YJNFREogvH12Q+sbVypNK3W23IDCux0DxWEkXY5vwS3qoSts066p SicJhWoyk5T2Pzg2gK9U//yUnVP0J2pZSWDZ40aC/I/BQZLfNeheq+K2uapo3f6PR767mzipz 7VxdoMJoXMHwSeejcKaGchqGaDMfBYM23HvHiRGeQZ5mDmAgrw= 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, 17 Sep 2017 08:32:17 +0200 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/tuners/si2157.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index aefa85718496..e3e2027a5027 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -457,7 +457,7 @@ static int si2157_probe(struct i2c_client *client, if (ret) goto err_kfree; - memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(struct dvb_tuner_ops)); + memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(si2157_ops)); fe->tuner_priv = client; #ifdef CONFIG_MEDIA_CONTROLLER @@ -514,7 +514,7 @@ static int si2157_remove(struct i2c_client *client) media_device_unregister_entity(&dev->ent); #endif - memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); + memset(&fe->ops.tuner_ops, 0, sizeof(fe->ops.tuner_ops)); fe->tuner_priv = NULL; kfree(dev);