From patchwork Tue Sep 26 18:22: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: 9972493 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 93CFA6037F for ; Tue, 26 Sep 2017 18:22:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8586D28F55 for ; Tue, 26 Sep 2017 18:22:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A87828F56; Tue, 26 Sep 2017 18:22:53 +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=ham 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 EEBF428F4B for ; Tue, 26 Sep 2017 18:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969947AbdIZSWc (ORCPT ); Tue, 26 Sep 2017 14:22:32 -0400 Received: from mout.web.de ([217.72.192.78]:56158 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966343AbdIZSWb (ORCPT ); Tue, 26 Sep 2017 14:22:31 -0400 Received: from [192.168.1.3] ([78.49.148.35]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MRl5x-1dmHUp1dBh-00SsWX; Tue, 26 Sep 2017 20:22:26 +0200 Subject: [PATCH 2/4] clk-u300: Improve a size determination in two functions From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <781271c5-482f-d4da-e91e-3b048bac69c2@users.sourceforge.net> Date: Tue, 26 Sep 2017 20:22: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: Content-Language: en-GB X-Provags-ID: V03:K0:t3I3Ro96w5rswURQaz464cJnXUnfJDf6KnPRM+2kKGmgHh0kcAU SRWC9gqNTtB6uNNFlRBBwbg0mIAFtUkfS7BLsoldD4fuNirtJI9iMmap1xSIGOLLM4KKvX4 V2Din2MEBx6BxxUa7wzn+wM9q6KgM/Rww1UJHqxS+9soBgYUvmLWtXbOzT5XP5wfLF/buOw xQiX9BYL/TNBod8LmYvMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:QcAqsAKORf8=:Pb/12K45vhlF+gonm4N0Vu M4c/mHCthptHG/pdCeR+O2VGWJxMvH6zvxDFLChSLMgGgUrgc3iXR+fSnNgefFSHQZVTfdf9x aZDzAA4OUMmH/YzoKlTpHQT4bc5k+lyaxFVqO371I8XPqIOr4eTwnTg5uaY53ZVOsKjoLxr4j y2MmtukfBWE9dCO8We9jsAOZ4mP7UFX8Hb1rlMAfpf88jxWHlHDddxIuqx42U53S43gxagwor +Mam+q+EJ38Q2WTOOaCZrGN2b9P/FgTE6Z6krgd8Z7liNMGE/gzcZ0xs2wdSv+7yRTltKcSyW 2vXzNRUYEUiID45sJ0DPTQlPCau7sNVcdUFriq2Go+S4EHeDsejnfaBCVx5MMYPKPcab8xs7A hZTQrJoD06VcmY+t9QkT2+xQCkecCjP4TUCpWzrCUOKstOkWdhhs3L2VWRUv8YWDeKX+j+CcM Nw9lzN1qOUyIkYM3xp4dEleTGDB74xcXR69+HOOoHQixD8+rYcC1wdPVsrgwciTyLY5RgMcjY tDYU1s8ha7yY2LXyICVwC9TfKCotTwqmuGHjRaMw+2k5NKuugUDK/+Ga+ZQ4sVwEEWJso9+kO Nh9HhmWDogTI4a4/OLzFE9B5tstoD3ODL0YCj11jnXi6EOoF924YzPmEKUb7CsmeKF7mFIIRm eVJq0CTJ6+leaMniMZGBZQuRxgUQdsA5pHl3bYK36wVV0QJCiU1H3gValJlMTXLu4qI1ul1kT CDZpi1FG/7+ns5JOCmRw/+Iz7ZtdS2CQIUTWWd/8LbC49PnEEaY3YFL3Ex35J5srgXeP1MmZ4 rP5HmMYh2NF8+08Td6h3M8ze0rCIZBfouVTSoHDPBlvpMObAUw= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 26 Sep 2017 19:33:02 +0200 Replace the specification of data structures by pointer dereferences 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/clk/clk-u300.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index e524c3775264..ae78461c7836 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -702,7 +702,7 @@ syscon_clk_register(struct device *dev, const char *name, struct clk_init_data init; int ret; - sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL); + sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); if (!sclk) return ERR_PTR(-ENOMEM); @@ -1121,7 +1121,7 @@ mclk_clk_register(struct device *dev, const char *name, struct clk_init_data init; int ret; - mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL); + mclk = kzalloc(sizeof(*mclk), GFP_KERNEL); if (!mclk) return ERR_PTR(-ENOMEM);