From patchwork Sat Sep 16 13:38:59 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: 9954317 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 6ECB860352 for ; Sat, 16 Sep 2017 13:40:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6142D28B54 for ; Sat, 16 Sep 2017 13:40:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49F77288BC; Sat, 16 Sep 2017 13:40: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=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 F354928B13 for ; Sat, 16 Sep 2017 13:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbdIPNjH (ORCPT ); Sat, 16 Sep 2017 09:39:07 -0400 Received: from mout.web.de ([212.227.15.3]:61148 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbdIPNjG (ORCPT ); Sat, 16 Sep 2017 09:39:06 -0400 Received: from [192.168.1.2] ([78.48.47.134]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lx77p-1dM7WH0vnt-016cYY; Sat, 16 Sep 2017 15:39:00 +0200 Subject: [PATCH 2/3] [media] si470x: Improve a size determination in si470x_usb_driver_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <53bfd9dc-b0ba-5cf0-0aaf-0db358a10082@users.sourceforge.net> Date: Sat, 16 Sep 2017 15:38:59 +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: Content-Language: en-GB X-Provags-ID: V03:K0:VSbxdApYiDClSY8FvQm7Gcg3RS/eZOrDGDewnPpwXsuKtDxfSpG htux+IYll56tanDnNR5NvO9+f2qNpcVpj9QvOTWM7lYdWgTx/7cIFg0yCEppBHJhiMedQlc lyo09LJNNblnaPJvuFNq11cWf60kbV7E16wKyMMc+dBD0AFNguPoLrfwP13Kpl7GnqJ1d5e BovALzz9m9csujAO1GvQQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Z18eVxryuLk=:O2s4f+f71LsrlmR/wxGMXS h9i10UY7Wz5KJyyc/9wtLrSE8Ozmr3WMToeLlRbq8/1vrs1/0RKbl6j9Jg7uAUHF1zMnuNiaZ fGq9eoC/CKP34uGOqpeZQspVuyYVY9kYRLxiKmCGfaOdzdcw7zHxs0RsOtoUijvD24rRgGNTm zS3iqH+sSgjbpHFOO9lksiE3CGb7zBN3ZkJ/UPVitjiTipIjA85d2pjRf6qrhENflEMSwMqcT V2vqgIaYV7jtMXLsEwBUp0GOCXJBPw5/gTp8KKETZuFdtbMv8bg8w/sRRyxMdnpCDnTwlkQzv zaV1jAkXh+RpAE4zdwcEArMxJEzq8g+jsGglnOOorM6hX+AeGnN0/eQWNnWIxYWwQEGrx7WhE T3DZppDaBAJJv/KP7v8fwhAe4mFiL0PFcTvbiQZJbwuUx/nx1Ca5MkX7QUyuF8v9R96xPBtLc /zU/iSlWNII4qYypO1lJn7Rg4J1cvIeLi1ycrlCopxeOOnQjJsdXq3uxcnxB9nxy7d6tuGiUW fcO7DnlE+ebB1eDlBSrFuAMgFNYEglStR5RY4Qy3fHhGxQ3j9GLvPrpQ+6Sxf8LybobLTsYRp oeDIuBiLdgRFdQwMQ9jbbL0Z5rM6WkvrQYOMjXhoKEj56QPFGjORl1mYOOYLSquQ2xInz0Df8 DzJ4ZZ4w6HqAXSUTyJPkZieMCQxi321MPBjPGq4fb4Q9oc1u9MS8IS4SWFL9U7E62CnBbQEKX Y1jMylHhguZmu00nF2yeR2UXbQc5X0RniUNl8sqHBUy/sqLceyGzwkXyJbKsH5HB5WPNeoSvg cdxqB4z+FebgsHwK07NQjZFLpa1jTWmRb5m0YEyENdSAINTgyY= 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 14:58:06 +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 according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/radio/si470x/radio-si470x-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index af295530b20f..6fc6e8235f20 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -584,5 +584,5 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, /* private data allocation and initialization */ - radio = kzalloc(sizeof(struct si470x_device), GFP_KERNEL); + radio = kzalloc(sizeof(*radio), GFP_KERNEL); if (!radio) { retval = -ENOMEM; goto err_initial;