From patchwork Wed Sep 27 18:47: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: 9974581 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 18F3C6037F for ; Wed, 27 Sep 2017 18:48:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D4E02916E for ; Wed, 27 Sep 2017 18:48:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 022C0292B2; Wed, 27 Sep 2017 18:48:31 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59C032916E for ; Wed, 27 Sep 2017 18:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KxiKjCdzuUto4/OLByKFDCsqlLzZuIFYfUo5mscHcyA=; b=AVgR7udtPXyeUl 3wURt1QJg69bL1XI4rsijfgCf3+3/wgfKINfECpkPfeIveVVF72W1aT5Xg6d5gLEic402NvqZDC4G 8y82RXMwjVhqeSCRgVg0LN/uzsslWCS2EswG0gnzOtSWDa1m+pVJu2nr13qAKSFzk/AxnG6Qt501u vo+Lk37xlY8Kaiad0mRE0IL1hVGshCSvp7tIzFm8qz/2VJ2NKWsS+OIHjF6IiGD2OICwt9jn9092W y0Uu2hmUJWjFxstVfnYE6Y83Hvnwrg0ZOjmRIGsIi5JqXWEGxt+MATlkeXogTQV85DekQ3ugniXSn SJFtlM4wuP3jZSJ8gE2w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxHNi-0001rw-6b; Wed, 27 Sep 2017 18:48:26 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxHNd-0001de-Mr for linux-arm-kernel@lists.infradead.org; Wed, 27 Sep 2017 18:48:23 +0000 Received: from [192.168.1.3] ([92.228.186.72]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MHp8z-1dvuzZ1Oub-003dZr; Wed, 27 Sep 2017 20:47:56 +0200 Subject: [PATCH 2/2] clk/ux500: Improve a size determination in three functions From: SF Markus Elfring To: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Ulf Hansson References: Message-ID: <1991a7d3-59b8-1a5f-dcef-a0a493e3829d@users.sourceforge.net> Date: Wed, 27 Sep 2017 20:47: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: Content-Language: en-GB X-Provags-ID: V03:K0:oHqHnMX8fWF6vuHBVjE20vSUd+wSa5K09jqpj2iiVb/kmYYpP4C +Mt7jGU1vczMqdl3vJxznZ4x6yXmDQOwN2k9qQScwk/JUDwEHt6xNAPTGSzBlyMX3GSflHp rYLSQbfXziOXf/J/AmoaJQni3iTOhY6vAVoWWWDQeKQAjZCw2loufMDZsnen1mwHevv/oD5 x+/u/V1m8dDcRfQmTplNQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ALYBAYko88I=:3ELAm8cBilU207hiUBrJ89 6otUAYdID2gFSt0QH1vYhcbyakbMvMRIWO4djIxIK0ziogeO8FcLhveuIyMIhA3EriyRtHa/q GqG36Z47iMo95VBlw+8PPqG6rVTrafRV6DT7N+cj9b5i3nKYX/yW3DUjpoXCP/5+4VKMQfkCh fpDwMThrAguUCRAYtbMyfTRATJBHjn5naQbcZaHbIHgr9G4T90xuo/x9iaKWlqauSBRAsnow0 Bamn1ZWa2GrMeIxjk5cZMCfRrc1qRXyzYXJFVL2CP563K34tn5Gp3snlGmOKCtVG+AM39O/vZ CwJQtVP8qVwMjWii3OeMk71VYgIrjJmF2Q5z+b9blQDzeJq8Su0o3tTjBr36ZBM90EiA4wrbA 1Z2AgXP74Q6e9/p+XirGovdYbVCZrQnE/RAnt3cVLScvVFp7AmZBkVEDdlwz/qxa1/NvyWslX qpMgQW7AibJI7HZAUpa5Q8tTt7cE2PymIUw2ah3k/qbZqGGgG49M1Vpy9TmQBZ+V4G7HXaoBh 8HnIZZz1RUDbp3jwGqNgXniAcKbNXgFJbs5AecTynYkOAPwto6NiuPhA8Yu4gEG5PLgxaAOa1 PcAmucokJJkFZpKONwGXofNC90UZcptz4zHODnEMfp+Q5qDRsYZp+e4thz+HZmIK6j9YguDVi qLXbDr/LZRKyRM6EiJ7jO1tNoDwxu46/rg9rviasRl/uxfqE7iDggjla2yG09HNl7DeF/sicG zoSVzapekmKrcYWDPncZ22Nu1OpuLhQs9oh5jO9dFWWY4Upo3cv37/ezf2cGxj0j7aTkJ2Uiz 54zPj4sUQ3fC6C3F/Q0VRVRgoS34HK2ztcuCeoZ3jEBQ/KnxBM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170927_114822_097483_862ADE5C X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 27 Sep 2017 20:30:53 +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 Acked-by: Ulf Hansson --- drivers/clk/ux500/clk-prcc.c | 2 +- drivers/clk/ux500/clk-prcmu.c | 2 +- drivers/clk/ux500/clk-sysctrl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c index 5ca07e6d1f64..7cfb59c9136d 100644 --- a/drivers/clk/ux500/clk-prcc.c +++ b/drivers/clk/ux500/clk-prcc.c @@ -107,7 +107,7 @@ static struct clk *clk_reg_prcc(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc(sizeof(struct clk_prcc), GFP_KERNEL); + clk = kzalloc(sizeof(*clk), GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c index c137934f23ab..9d1f2d4550ad 100644 --- a/drivers/clk/ux500/clk-prcmu.c +++ b/drivers/clk/ux500/clk-prcmu.c @@ -258,7 +258,7 @@ static struct clk *clk_reg_prcmu(const char *name, return ERR_PTR(-EINVAL); } - clk = kzalloc(sizeof(struct clk_prcmu), GFP_KERNEL); + clk = kzalloc(sizeof(*clk), GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM); diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c index e0a834c08a04..7c0403b733ae 100644 --- a/drivers/clk/ux500/clk-sysctrl.c +++ b/drivers/clk/ux500/clk-sysctrl.c @@ -139,7 +139,7 @@ static struct clk *clk_reg_sysctrl(struct device *dev, return ERR_PTR(-EINVAL); } - clk = devm_kzalloc(dev, sizeof(struct clk_sysctrl), GFP_KERNEL); + clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL); if (!clk) return ERR_PTR(-ENOMEM);