From patchwork Thu Apr 20 08:22:10 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: 9689855 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 22E5D60326 for ; Thu, 20 Apr 2017 08:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 110D227DA4 for ; Thu, 20 Apr 2017 08:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0513928448; Thu, 20 Apr 2017 08:22:38 +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 AA65E27DA4 for ; Thu, 20 Apr 2017 08:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965345AbdDTIWW (ORCPT ); Thu, 20 Apr 2017 04:22:22 -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 Received: from [192.168.1.2] ([77.182.247.81]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MMqbf-1cwRaP3kxr-008XzP; Thu, 20 Apr 2017 10:22:10 +0200 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-Language: en-GB 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-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 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;