From patchwork Thu Aug 31 19:57:53 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: 9932777 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 08B3360362 for ; Thu, 31 Aug 2017 19:58:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F166028A32 for ; Thu, 31 Aug 2017 19:58:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E647928A3B; Thu, 31 Aug 2017 19:58: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 9E74428A32 for ; Thu, 31 Aug 2017 19:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751346AbdHaT6B (ORCPT ); Thu, 31 Aug 2017 15:58:01 -0400 Received: from mout.web.de ([217.72.192.78]:57538 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283AbdHaT6A (ORCPT ); Thu, 31 Aug 2017 15:58:00 -0400 Received: from [192.168.1.2] ([77.181.81.131]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MYNzx-1e0tjG3Dov-00V5nO; Thu, 31 Aug 2017 21:57:56 +0200 Subject: [PATCH 2/3] [media] mb86a20s: Improve a size determination in mb86a20s_attach() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann , Nicolas Iooss Cc: LKML , kernel-janitors@vger.kernel.org References: <9571ee6c-5137-15f4-4cdb-9f03b5cb9268@users.sourceforge.net> Message-ID: <5b72d4ab-0bcb-27ab-6240-18d251f49e6c@users.sourceforge.net> Date: Thu, 31 Aug 2017 21:57:53 +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: <9571ee6c-5137-15f4-4cdb-9f03b5cb9268@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Rfih9cvXhYTHysgqAJJ4eLgdYfMy27BkSN2xS1TNkojwKGHuZ4p 6qNGPKKibIf3WNub+Cb+zVrCNnok0RKNaP9SY2rLbwWWpuj3W2czw6wIV93G+Dhe9v2jx3t gM0I5qEkEKzWBHb7+VDHEqAd79mbuWR2MXe/DrhHuJOSfoTqZd7st7uk8gtY0LIrgWQDuzP +OJwo9hbjGIw4OrD8xxsg== X-UI-Out-Filterresults: notjunk:1; V01:K0:bzqA/yyJliE=:gcPWgoDumqxbdDAnDAx0+m xlCl2WPWSoMzsifP9dR5gPWj/k4K8Yo8XcgB57pI/m2CdqwGqbbBv6vonVvU6SiO6QePUo+8q ry9pqgrj3H1hPtZKgYsHNAgruXnEoLQu3PvNNGbbvaTf0Dl0VA8lV+avslxsnWnX057tWJhmd 0sN2DWOuUFuBWxhJQ83wc6j+mE9Ae6XYv14AuEYnKR41jnRhiPzKH3zQoy1A8YPhM6yfufpBR pUTeqVlndlpPXximFjBkrJCJi+trS49jOBNrbbPmnkOAmr0bVzkeFLnyqI8FDX7IWm5bYORW1 jJ/c28n5QXp9XSMTwNp85N5ZWTKlqC0um2hI37y7GnLKFankmmJS309Z843VNYCtHOszstLj1 D6HPhaK7XPppxKCzfXs4anYLWnmQ7xMVST2kj8xyuZ0SU7OssD7Agrvl1lZJN69Jroyg871ok KqKV4rbwBCI8qsoDe8A2cdorwL7tP4+6Lp8c4BRhB7zNgUUVIlBIpgOgvFVUQgciA93wsauOH 6JkL8mMLcNJ3U1/fO37oP2pjiiJYEvqhvb9ATSHwjBF/4qqTg4htFMkjWYySjc+UIgVAh9ZgE b2rvjMyrhUispunvsThEhcRrrc4OKijr7U83JtilQTuzhJfThGJ8+yu82mJty+5JomMGzzfE0 24eHYpsbLk8IKtfGy68YZgNexp0yDyWjt4prZp9Cb+y/tlt1ql5FLhPVQoGWU1Fbw/85UR9Ab 7rethPvSJKBsbqgXJP6hJA3UfeYl+4uzXRMe2UuOMfvMN4ZCIvhWP/Ds4Ss3/A1HnMeygWL0Q JxtUZsfAlDOHaInIN5MoKC2rfF6ilzzYb0LGNxhinV/s60Nqjw= 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: Thu, 31 Aug 2017 21:13:26 +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/mb86a20s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index 340984100aec..ba7a433dd424 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -2071,7 +2071,7 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, dev_dbg(&i2c->dev, "%s called.\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) goto error;