From patchwork Sat Sep 16 20:10:16 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: 9954469 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 EA5C5601C0 for ; Sat, 16 Sep 2017 20:10:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA21328C8D for ; Sat, 16 Sep 2017 20:10:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEC8B28BED; Sat, 16 Sep 2017 20:10:36 +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 8FB4328BED for ; Sat, 16 Sep 2017 20:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427AbdIPUKW (ORCPT ); Sat, 16 Sep 2017 16:10:22 -0400 Received: from mout.web.de ([212.227.15.4]:60332 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdIPUKV (ORCPT ); Sat, 16 Sep 2017 16:10:21 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LvB2o-1dTQrb2FmM-010J2G; Sat, 16 Sep 2017 22:10:17 +0200 Subject: [PATCH 2/2] [media] m88rs6000t: Improve three size determinations From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <278b14e0-f717-7471-6dc3-45dc98d64443@users.sourceforge.net> Message-ID: <5bec5eaa-faca-ec11-87f4-4383181525d1@users.sourceforge.net> Date: Sat, 16 Sep 2017 22:10:16 +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: <278b14e0-f717-7471-6dc3-45dc98d64443@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:j9nsvFj0vN5N/eJjPGQLTdzlIK77bRE1EfMSeCYIUThfeydXMWB v8Se0H3ouiIa546OX5+2MrL8WWpDj6MaiRgOwqdDuery6fKhCbMluNRDSlVlOaNzTl93G70 8ZN0DynAf1az3Ica51rWX5Nes7FOVzg4U5piaQRrVXae7RxyL3rqwykpbXNJJntu356O2Gs uCzpadmpr4VlBkZQhalxA== X-UI-Out-Filterresults: notjunk:1; V01:K0:OOZaPk+/9pc=:aVSxeRQOsbp96Uq48oR61E 789vBaOXp8c6eo6EZHWtKaEyyfFZuBMpsEWDdARCiBi2oBPbvn11J6RR7q1tPtuREynsHiL0i 5rCsJN+UPwyizU4F87JwCpc5xIhxRhbpLQ2RKdN0QjZmR2luDVWliuAwZd9dNZPbdOebQ0sug 6+5xunIO2epgHO0tOjJBw7doUmKntg9LM9gNNlRC10/WlTJWzPwUXgHzfpXSv9z/BU2QpznGr wT7XD0PSCsMjhD/LsN0lLQjUXHnvcDwaFwIss0qbompwI9r67Fz9JvXasTdZ0JCQ72ekG3WJ6 81cmTuzur523TFudinJC1P8AYfp1y07H+5RXGnRLC/H6HZlJcna30yr8njpkZKJjivAPPlOYO OYELmWO1gaxEoAY0/xbRrEnGlQxYayz5Shp9+Nk7+ouT0HV1dlQIuIsgehRaibzLgDHXfh2TW PzaolH/u+EzH40oAD8iLrFgY3ZRKOwRhaktSqDo96JXH3UTq5zNuqwURMHynwQQQjmuG3fg45 xjp3Rp7y+iXhx+nNrFTQrVxy7/Bl47HIcM+yBbmROKbCD0bRxKPhNvBZfpNNcsB87f2MMqQZq RebfyvAUEIxMZTAHwoL16z5tLSnc46WjhahZvIW+9XVdhZBQbqKUnSRJ1SDEIXUg4zsypPPXa ByG/3D4AXzxgQU2EezHZe9Q7ZM+ureleebTkmlqJGYYTXXW3x+FyRGQ9Gb6+1uCjskiGIMB82 qEWlDG/R/8eNlE8wefYlV7MRsXqqpdTUb73YyXNC78gICmcnCyVjXbHhvFao6VBSCplyWSKPW hWno242DkjmRsHEJFEuydcdmIQ5VV72Fri9oRAUrDkjJcu8KNs= 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: Sat, 16 Sep 2017 21:38:03 +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/m88rs6000t.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/m88rs6000t.c b/drivers/media/tuners/m88rs6000t.c index d89793a05862..1e55c679b25e 100644 --- a/drivers/media/tuners/m88rs6000t.c +++ b/drivers/media/tuners/m88rs6000t.c @@ -629,6 +629,6 @@ static int m88rs6000t_probe(struct i2c_client *client, } - memcpy(&dev->cfg, cfg, sizeof(struct m88rs6000t_config)); + memcpy(&dev->cfg, cfg, sizeof(*cfg)); dev->client = client; dev->regmap = devm_regmap_init_i2c(client, ®map_config); if (IS_ERR(dev->regmap)) { @@ -696,7 +696,7 @@ static int m88rs6000t_probe(struct i2c_client *client, fe->tuner_priv = dev; memcpy(&fe->ops.tuner_ops, &m88rs6000t_tuner_ops, - sizeof(struct dvb_tuner_ops)); + sizeof(fe->ops.tuner_ops)); i2c_set_clientdata(client, dev); return 0; err: @@ -712,8 +712,7 @@ static int m88rs6000t_remove(struct i2c_client *client) struct dvb_frontend *fe = dev->cfg.fe; dev_dbg(&client->dev, "\n"); - - 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);