Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966039AbdDTIWX (ORCPT ); Thu, 20 Apr 2017 04:22:23 -0400 Received: from mout.web.de ([212.227.15.3]:64015 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965053AbdDTIWR (ORCPT ); Thu, 20 Apr 2017 04:22:17 -0400 Subject: [PATCH 1/8] clk: si5351: Use devm_kcalloc() in si5351_i2c_probe() From: SF Markus Elfring To: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Message-ID: Date: Thu, 20 Apr 2017 10:22:10 +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: <94b24eaa-c5fb-80ea-441a-883989d14ef5@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:QRKg/OxX5paXxuUfWiqre35Xmh5NxHMRHmy5OoyBK8Eh2M9Gfmm 2wQmpJ7DdEszHgV9AWcAFp/Q2SRYdC+YCk6l54DG2ALkjvK2bq+btacr2OV7ys5AmhF6Ktq XF7hgpN+XJz4OPLRAMXdjGe4P4kqNrs16ASLKEhs5kbnqGXMhMhHL7XGYWyDcRp4R7QXGDY 3GcUOYwIuxsGqZ69A1t/Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:tGkOXVE0KJE=:sxJFYBa5LWCEv5IUZikgrI 3kAWqkzoSpH1kCbqUVRZJSPyeM3+naeYRxx+bgegc+vsD04Xb8WdBHhEwhdFmC4Ozmvv300fA bAhhLsV/lTNCazVEbugcxsPJA9gbMEy9Gp168Jt9WsszSMvf/imm6dmFrISdfp8H/sSJ5qAvo tyZ1MXMjyDVMzXk7waC6NMk+iSb+LLY5/tksLTww7DATYQTN2kwWTf5NTCblpR0tevml63AxJ S/KzE9tm3Ea+sLQ+xURKUBX6fddsDVe/W+mj51c6EqTx3f5zyRniJHi2K6E4HFSwSaERg0SOn k7zij2ps4YU6CcJHq/dmLr0csISvivxg+u71hn8d4GzYMrXlYiw6BD4eyR39itucpX8gegIV4 yJlSNc9XauLMO9rXQIW+LJ3aVeWtlQNuvP15FGWfxyOLTUR831VljsXkW2WTqzSl7uGPwjZ3y Ej5pR3spIZ9byUWSuCYm00OJyomsK/Fxq9+l99NqoUoAd/dJa1ReAW64LNf7nCMT+8iAn+eYm 5NvB/h2w3Ow0w1uspY8TlO7ZdPmmYAyfgw0pyGOGH+73Qj1zgBhbCqqVld5HVmSqGuHDbMSzf 6RRjw0GOpySCPJRg/fm4GNt1Y1YR6ZE1q15yZ94fvVpNPenBACzzXrHo5eUvthjwkCkXE+TNm BNhSw+0bUriANgnK0deD+bDTmibHtlZJBrezdatlgVtnRFqARzdjEbDkbF4dSV/P/Kk+SMt2O xJI29S3yP9MuYxxeHzMIj/WCK/qjxoJT3ts+ZBsSe9yobS2vmX7rg4Kcy2lplVjPqRrA5BRh2 5VCIUFX Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 32 From: Markus Elfring Date: Wed, 19 Apr 2017 22:37:30 +0200 Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "devm_kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/clk/clk-si5351.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c index b051db43fae1..a4c009e1e70d 100644 --- a/drivers/clk/clk-si5351.c +++ b/drivers/clk/clk-si5351.c @@ -1535,9 +1535,9 @@ static int si5351_i2c_probe(struct i2c_client *client, else parent_names[1] = si5351_pll_names[1]; - drvdata->msynth = devm_kzalloc(&client->dev, num_clocks * + drvdata->msynth = devm_kcalloc(&client->dev, num_clocks, sizeof(*drvdata->msynth), GFP_KERNEL); - drvdata->clkout = devm_kzalloc(&client->dev, num_clocks * + drvdata->clkout = devm_kcalloc(&client->dev, num_clocks, sizeof(*drvdata->clkout), GFP_KERNEL); drvdata->num_clkout = num_clocks; -- 2.12.2