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: 9974583 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 BF0B26037F for ; Wed, 27 Sep 2017 18:48:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B39DA290C5 for ; Wed, 27 Sep 2017 18:48:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A831D292AF; Wed, 27 Sep 2017 18:48:42 +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 73A9E290C5 for ; Wed, 27 Sep 2017 18:48:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752326AbdI0Ss1 (ORCPT ); Wed, 27 Sep 2017 14:48:27 -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 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 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-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= 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: 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);