From patchwork Wed Apr 19 19:52:55 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: 9688767 X-Patchwork-Delegate: sboyd@codeaurora.org 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 3F76E602C9 for ; Wed, 19 Apr 2017 19:53:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30C832787C for ; Wed, 19 Apr 2017 19:53:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25ABA28429; Wed, 19 Apr 2017 19:53:04 +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 D52822787C for ; Wed, 19 Apr 2017 19:53:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938958AbdDSTxD (ORCPT ); Wed, 19 Apr 2017 15:53:03 -0400 Received: from mout.web.de ([212.227.15.3]:51658 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764850AbdDSTxC (ORCPT ); Wed, 19 Apr 2017 15:53:02 -0400 Received: from [192.168.1.2] ([77.182.113.86]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MAMTy-1ctpBq1EnS-00BeYc; Wed, 19 Apr 2017 21:52:56 +0200 Subject: [PATCH 1/5] clk: mvebu: Use kcalloc() in of_cpu_clk_setup() From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <8af5ccb0-f7c1-297c-2661-8ced61302c37@users.sourceforge.net> Message-ID: <9377530b-9b07-bfc6-848c-b0c1994e33f7@users.sourceforge.net> Date: Wed, 19 Apr 2017 21:52:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <8af5ccb0-f7c1-297c-2661-8ced61302c37@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Z4Zsu5z/UEmaJ6MyrjuCxupvvBuNOMkIwdIn+9XWHLvFg/TIhZU zvQzOuNpGZYLz93Mg73DPDsIV9LA0UyRS615p8X/tlHLAIcn2hkJs8UVi+yA80YOxALbIP8 Ofceh2tizwiE00JmnEa5GChgAcl2E1W3Fc/PVf498eeGY75rOBsJeafnkcvMHy1ElsDercA 9nPCPZ0iSOdJQJlKDZ1hQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:2V+OyoIIGDE=:ULqASsaUsdU9fX3D8YI9AI 6O9h/qSyZTAwHPQTsBcOL9QQq6yR5gywqiK2VpiC5PPfhGmqUiIF7mp1kCsAcRUdkq5WDXfy3 Yqvhkfzv6PfXDjQR1kE/wzArPy2pyT+t78lYh/oBaRiHBaMtmy25OUl0tIr0r5QJkYTjUSQXD 0JWKmqUOs1BtRfaPPlcngZOyKq7YNqs4rfyHufulFS8ZPAsKFoFA2M+gdpd7b3vgrb/nwzsJW cwQds3X2ySWevstpTY9NKY+GT8V+JOLA7a0pFF5fT8KWw18KHBqoaokrP/ImLO1x4ccPs7EwL 9ha+oX0Uoy0P7sLh4xnE4bwXaTa658we1k4W/eHJHqj09jptG7cmdukvWro52Wk6Sz6XwG1Uo 3c8jm2a8tLK3vjcsaJzXks4xouE2r2ZrhjhY/AWoWUIm2xb+qHCfa5TCg/xpvT9zHTKSp5+VR M2J9MP9WuAdWDLfp08YfbdBZAt09H119AQVbQP+HfTnDL9NaSgmCMG02NWfRrSmcO0pE7TxUO ohAxZnX1JrbIRr/nL+LfL6yK5O2dvRyusW7vDe9j07b14ZQQYzXWb7er1o+0NsLcgVG42iPVB SAvy7pOPK+5sLq+PoRUY6cc8jZjFue//HumKiIotpAuo4y06gIJ8oLvGmV26lIypASOssGUNK P74Y1naqpWsre/VBjQgKYIljvgoUmj0Ni4g6xymgDohCT9CAw6UBXAy3jhTwOIP7UlK8w6irf 16Y2jFUr64G8w4ucDzaLc8Ggmvw9WcIdiHTWk0CpR8Pe9UwZCviOGpQigpurK/SRo93Mu+C8t MJb/xIU 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, 19 Apr 2017 20:15:21 +0200 Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/clk/mvebu/clk-cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index 044892b6534d..072aa38374ce 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c @@ -186,11 +186,11 @@ static void __init of_cpu_clk_setup(struct device_node *node) for_each_node_by_type(dn, "cpu") ncpus++; - cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); + cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL); if (WARN_ON(!cpuclk)) goto cpuclk_out; - clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); + clks = kcalloc(ncpus, sizeof(*clks), GFP_KERNEL); if (WARN_ON(!clks)) goto clks_out;