From patchwork Tue Aug 29 20:33:25 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: 9928257 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 E01CC6022E for ; Tue, 29 Aug 2017 20:34:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D38D428A55 for ; Tue, 29 Aug 2017 20:34:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8AD028A5A; Tue, 29 Aug 2017 20:34:04 +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 7BCF028A55 for ; Tue, 29 Aug 2017 20:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492AbdH2Udg (ORCPT ); Tue, 29 Aug 2017 16:33:36 -0400 Received: from mout.web.de ([212.227.15.14]:52744 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbdH2Ude (ORCPT ); Tue, 29 Aug 2017 16:33:34 -0400 Received: from [192.168.1.2] ([77.181.80.150]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Mare6-1e73uP0HX8-00KPY5; Tue, 29 Aug 2017 22:33:27 +0200 Subject: [media] cx24113: Improve a size determination in cx24113_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <36a5402f-c7a2-edf0-1af8-b98b0684d8e5@users.sourceforge.net> Message-ID: Date: Tue, 29 Aug 2017 22:33:25 +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: <36a5402f-c7a2-edf0-1af8-b98b0684d8e5@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Qv9KeR0bqkaALnIVhAixnF97mdgB4/nNwOpfgPFvHzW73ZOVXQh zpKiQN3S5i6AQgWLufC3Ghi10VOHR17mZTn6m3jPMKEogaEVFQ+9egztgUvPBl5I77fVmmY t5oKxswt/eDiyR6euZ9T+DjOVHfPV88+aLQBMirP0QD6btAhxR2ozyoncSO+/QaoAA4QniT ftEy8rYxHJ4W0QX/mOaSg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/LJjS2cVN6c=:Ct3xhWZcBaAtRCROCPovPk KK4V7skLCz06Znv/sdxmfv29MuEYYw+sFdcQ/FzHwVPR9DfnP/dG3TNGaVKnfNMWBnhUy61Vn Vl8v09k0e/VFou6eH05+lNNDZo2873irwjv7zRN0dCHMAGDBW++vVe/J3BlrIQ4OKht1NjYPQ 1LkcS83uM7uCyhr3c9htGap0jgkVrxld0pDE+dNMyP81BAPEsv6HJ+xmS4UR4MYaENjw5XVYd aIj2KFBV6S70SgXvRnA4GliUcxrIxt/q2XdWKgoACEHW8rGOjxNjQGpsUt8OtdBWWYE6AD4mb IrIIQcsMpq6ErixDPoXkw3hVLCDkuANAC+CkO3CwXrjuvmDIB6spIOwGfpH7jmRYiYSOSQ4lc Zlz7ZoKv/Hrbp8J3AHJQJyGnfmkHfCZ+iwAyzr7B6gZmE6lY5ZZs+ZOnHvk5jhbiui8e8fuQJ PSpObW6LKuV1SL0E/xwUYbDOIqhVlfb2+9GuLBqx74uU3oC4gaS2TnPv6jv5aeLs7GoIFUqzs JTCEA/l/s3TkofJG48nDMgqfuiAY2/rRcKVnZNC7F/e8kc9XTNiYsf1p2xjP7DYBqVPUHTbN1 UyxtWAsIAd1REZCxj5Fcz5NYIMVYai4bli1zvtY3vXhTj2TOdW7QWLjtMEZPN4o5CwBPcJrwM ClYYpZQIafGTOpumtckJOc4Vr07tymuBAu5mv2iLwa3BHKN1BKf7VFN0HcUmkqD13v27SyEtn LeKFfZ21BsH0v0ryEpP4JBaDRZyhu2OFHCWomJVzyVbvHdiy4bJO28QzV+DJuMi13c18fG8M/ bcXEnHHUjZ16+pasDRkhcpsmB5zkXUr3iCAof6htQnuZnYIA8E= 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: Tue, 29 Aug 2017 22:17:25 +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. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/cx24113.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/cx24113.c b/drivers/media/dvb-frontends/cx24113.c index 09c3fd1840f2..ee1f704f81f2 100644 --- a/drivers/media/dvb-frontends/cx24113.c +++ b/drivers/media/dvb-frontends/cx24113.c @@ -552,8 +552,7 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe, const struct cx24113_config *config, struct i2c_adapter *i2c) { /* allocate memory for the internal state */ - struct cx24113_state *state = - kzalloc(sizeof(struct cx24113_state), GFP_KERNEL); + struct cx24113_state *state = kzalloc(sizeof(*state), GFP_KERNEL); int rc; if (!state)