Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969962AbdIZSWe (ORCPT ); Tue, 26 Sep 2017 14:22:34 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1216 Lines: 38 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); -- 2.14.1