Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbdI0Ss2 (ORCPT ); Wed, 27 Sep 2017 14:48:28 -0400 Received: from mout.web.de ([212.227.17.11]:59451 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbdI0SsZ (ORCPT ); Wed, 27 Sep 2017 14:48:25 -0400 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 Cc: LKML , kernel-janitors@vger.kernel.org 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1941 Lines: 57 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 --- 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); -- 2.14.2