Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938974AbdDSTxF (ORCPT ); Wed, 19 Apr 2017 15:53:05 -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 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 34 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; -- 2.12.2