Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030409AbdDSRyW (ORCPT ); Wed, 19 Apr 2017 13:54:22 -0400 Received: from mout.web.de ([212.227.15.14]:65491 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968759AbdDSRyN (ORCPT ); Wed, 19 Apr 2017 13:54:13 -0400 To: linux-clk@vger.kernel.org, Boris Brezillon , Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] clk: at91: Use kcalloc() in of_at91_clk_pll_get_characteristics() Message-ID: <2b5c3954-dc45-4f1b-5d94-397f688b23cb@users.sourceforge.net> Date: Wed, 19 Apr 2017 19:54:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:2kP87VI5YQFu6BazyEpzDEuvrAWkjhiYRhHuouDCTIzXdQsGZl3 454G6yBP2GEdlSQ0OS3l16Oawv+nWrZWsZ0fICmh6SYlYyB9ZZTmPe0aEJF0Ep9fIgjYXge Vb0EqkOGUDcK8w8/uR0uCxeTQlxk8tM/1Ohz/eCWQMF6K+4ZG946tO3hdb92MqVxceZONiM 1Kl0NWmhdZpMk+7nDhi0A== X-UI-Out-Filterresults: notjunk:1;V01:K0:P6jcocI46X8=:lkZxiQuRrGU3pnYTPAisK4 D1Zl2WfTdNCi+95LlzFTA38TaMwAeGEscQ8tetBu0OeZ5OS7QudZOZAmVTIB0ozslySPCXkun SZ6kWh1HFhCv222jgyIwzCAdAwjBbqW5Mw+6M72cCmOkTCdDPUTrFH0agfDFakAWwau4DnrmQ RTBbm6Q1E2c2WESX3B6mcrOTpziSVr+Zbr1c3X3AtlHZgFMMx/VsO/UZjbELwLCenSBfn5Srg c4UinkdhbkRHt0V2otjcSYZd6bzSsWCuPLWrN5VUABf0FWm5utLdD1fIW0nmE/yQ0GwTxbHPF N1vVZzMcKl8Uz1qvZatQLXyqar9y2LHrJmkhmYSX7ZmngJf8WgdaWK+x+MTKdGYNDWNN6rjF+ VDWoQ2jq/WsszrNKsVbo0OGBvVkK6Wr970mpBC8hhS8snITPpgVG46dUcnkYX2RAZxLB4SO1N Hy0zyZtK55ifz2EEPII27JuslhEuzLaaxUA9Wlg9Mbti2fOY225v37c4mNK2J12PqGz6HaNjx nUrGnERMQCygkdmyQRTr10qeHy1neF+ompOPVIVnbuw3A4K+kpist3twVehsieL0tsmBX+mEQ 8/odL7oO9XzIvFNc0FuBgSgz0rpS3PD+5Q7ZI4JIHa6XHeDowX2WnYQhk7HWhgeYQxdDR603h tIk2wtnuHPJX3KK7HxEaGm+6saJT1xIPnjYtX66I0x/RKjEPFLCBkAWCu1f+Qx2834fPcOJeX YtkkAOcE2Bz1apGEKFKAzaKeCHecAQdwyoiOKLEAdnLLGPzIx7jWptQ3dwB+kASoWrZEJHusZ A5KwiF6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 42 From: Markus Elfring Date: Wed, 19 Apr 2017 19:43:03 +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/at91/clk-pll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/at91/clk-pll.c b/drivers/clk/at91/clk-pll.c index 45ad168e1496..7d3223fc7161 100644 --- a/drivers/clk/at91/clk-pll.c +++ b/drivers/clk/at91/clk-pll.c @@ -399,18 +399,18 @@ of_at91_clk_pll_get_characteristics(struct device_node *np) if (!characteristics) return NULL; - output = kzalloc(sizeof(*output) * num_output, GFP_KERNEL); + output = kcalloc(num_output, sizeof(*output), GFP_KERNEL); if (!output) goto out_free_characteristics; if (num_cells > 2) { - out = kzalloc(sizeof(*out) * num_output, GFP_KERNEL); + out = kcalloc(num_output, sizeof(*out), GFP_KERNEL); if (!out) goto out_free_output; } if (num_cells > 3) { - icpll = kzalloc(sizeof(*icpll) * num_output, GFP_KERNEL); + icpll = kcalloc(num_output, sizeof(*icpll), GFP_KERNEL); if (!icpll) goto out_free_output; } -- 2.12.2