From patchwork Wed Aug 30 20:22:17 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: 9930729 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 001F5603B4 for ; Wed, 30 Aug 2017 20:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E87862878E for ; Wed, 30 Aug 2017 20:23:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD7562879D; Wed, 30 Aug 2017 20:23:27 +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 E4E74287A5 for ; Wed, 30 Aug 2017 20:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbdH3UWY (ORCPT ); Wed, 30 Aug 2017 16:22:24 -0400 Received: from mout.web.de ([212.227.17.12]:61258 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbdH3UWX (ORCPT ); Wed, 30 Aug 2017 16:22:23 -0400 Received: from [192.168.1.2] ([77.182.113.36]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lky6L-1dCiMB2Jwz-00am7m; Wed, 30 Aug 2017 22:22:18 +0200 Subject: [PATCH 2/4] [media] ds3000: Improve a size determination in ds3000_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <01634417-dd3f-acc0-f550-11a33e5c2a59@users.sourceforge.net> Date: Wed, 30 Aug 2017 22:22:17 +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:aXcqBN+L0bRkXL2ICdyKY4JCLe4i3v+YSCHvpCP50cZwZkJjyXg Pd9uE4FyDgW8AEeQ3fyvRLJaVA+zBIiyMzh+ENotHboWPUQGfF0ar1PThzLj3DUEeSQiLLD Llk1MO2yzH6fr4RbIjFlXbBQTh+mSyTJvPIknKMCbIWwvtbToIX/rNswQ4WTsarilO+k73N 1nzTsbK9wveJqa8JxNuyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:iCwgA5LBeoo=:tdgcAMkFXq+kVUPk0XyWvf u+Lhm8HAPxVhbyflYRcgxVLMaqQA+FW44HNOtZLQK3YbOad41Z/Q9Uaxr4/vrr4YzHLNqLn5y uUUjEc/dlRA+fwTzqnKjOxCApTpaeLX8j9HL+KbAXj0y6YMzqZ+NvxLhUiu8mGP/lhfro890p FwCXsv+5L3ErKep6BS4VvaukE8LlqJ9oVirRe2p11mn9QNLaKSbmeLTdFo+QQ3nui6NC7vqZZ q1aqj9PjLv1Pgwm67ofjvszXCg/EV93xd1C5hsvCrKLCYw69nq6ToMOlx/1n/lDIwXSjUL+vA o11JEEagqjSMwxIlEs63KJdpG8jWErwswQ+h9PhXkGMl467E5KcUurDYoVr9ZzDgtgkxDuPao Hfb3hlAcGHNbF3a1PsYO6HP2vL5sueZqMX08p3YnRisVwZVm4jFBu9yBI+U5/Vfir6AOSRvHj deZ3q732qThDt/s6Nb1m2hw6cyf1wFNl1oCUqrXjlab20Tz4S7y5QWuo/rt2jiCSbd0G/w4nG 9pHfVJLAbaLNYcvX9KYCA9l1qPyqfm1NGLp57kMlxMG++jX/otRCwUwehatfw91l9dvcaseR7 wGouT/uMp1p3k74fnNYiFDJKDI88e1IQ3yHuG55seLV23uKCyNHCsQduy1aRc13k2PS6TKJOc qHaMH/suPQxmbU3VAQ64ReP9ffvVbXLg/2Gi8DzceSRx+E25WToZ6uNqPR+TGGNyQRikzVQPT mGcSYhXKIzU6UixIuXu5GTh9lPbcBoGmKwZr1jVAaryeHfIEUIQqcjMiW8D5mPcfs2VFud2bY s3nEq6KKHkYJw9cicWVHSF/pJKOriu1aQLGuWJ5Lw782IoSu3E= 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, 30 Aug 2017 21:49:22 +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/dvb-frontends/ds3000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index c2959a9695a7..988a464de3e9 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c @@ -839,7 +839,7 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, dprintk("%s\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct ds3000_state), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) goto error2;