Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2820681pxk; Sun, 20 Sep 2020 19:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJsICFXp8BlCfyaIF5GxLcraRdhmGeAYx1TB5LGxlCn4sPU8zSoyYn9xnvnn08/OFeoFsA X-Received: by 2002:a17:906:a4b:: with SMTP id x11mr50377506ejf.368.1600654496766; Sun, 20 Sep 2020 19:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600654496; cv=none; d=google.com; s=arc-20160816; b=quI6knrl+eObxqECk98hyAM9XOKFpLAEwM4L19+gYdoJZTZcCyVa/yKT4vjFy1cH8k FyrzxwaO+tAllEnAIeF90NltK8QIsWFeckjjjjKSU1O1QmoGzhOHJPltgxmzuQrMng8t vtiDLMEaw5XB8BuAcbdwVDveLcaBEdtKcnZDVcLvyFGE77rMT51SvkoGlD0Eh7/bFjqq MlZpaS6OkM5XKk+CglGg7tGbWiv/JThZJY7Wu/rfl5Uowm5k4mdi+/yWgcfyYwuu4md1 k4muaIf9sl45imkeYkY2pFlagd92z1rp1FDte+9eHsE1EXo7Kx32isA9alM3IcFmzqqo Cj3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=KjzKHcqIHyTU9GxZzY45xVVx3IoY03bClTsXUditbt8=; b=EpPc+Q7jNE/C4rwWfw9mBXOtPgRrkgGG7qohoCP6KM3tSyiktrK/ikzb9wS5ECBIZ3 FAaqj9MitVGYMxPo9Gw8TR6u43gseZmRklmZl1MeMy3y6013g8BCpFybcLAzX3vea+sF IZfJQZzohmXy11P8wq/bEBLQ60YJ8hrGtMRzv6b2oyS3KZD6sF5Jh3MlFv2FOF5DvPjE oNuyW52A3Rg6qo6Macv/LbvKzTQCxac9YLzLW0sFjoRRsci51fHVrQrcLI0LxYPivQkN cjRqlIelkVGrTTYKwec5rgr+3YhfwtqwPMivuc42mXbmWxc4qTsjZLKpAowriXveOsRw Oa7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fw23si7588161ejb.402.2020.09.20.19.14.33; Sun, 20 Sep 2020 19:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726305AbgIUCH3 (ORCPT + 99 others); Sun, 20 Sep 2020 22:07:29 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:49136 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726184AbgIUCH2 (ORCPT ); Sun, 20 Sep 2020 22:07:28 -0400 X-Greylist: delayed 454 seconds by postgrey-1.27 at vger.kernel.org; Sun, 20 Sep 2020 22:07:28 EDT Received: from localhost (unknown [159.226.5.99]) by APP-05 (Coremail) with SMTP id zQCowADXPij8CGhfhanfAA--.57694S2; Mon, 21 Sep 2020 09:59:24 +0800 (CST) From: Xu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, shengjiu.wang@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Xu Wang Subject: [PATCH] fsl: imx-audmix : Use devm_kcalloc() instead of devm_kzalloc() Date: Mon, 21 Sep 2020 01:59:18 +0000 Message-Id: <20200921015918.24157-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: zQCowADXPij8CGhfhanfAA--.57694S2 X-Coremail-Antispam: 1UD129KBjvJXoW7AF1UKw1fAr43Ar4rJr17trb_yoW8Aw45pa 1ktFW0qFyjyF4Yvr1kKr4kWasxAa97Ca18t3W2gw1avwnxKr4kGFsYqr1UZFWFyF9YkF45 K3y8Ja4YvFyUAr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9014x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r 4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7Cj xVA2Y2ka0xkIwI1lc2xSY4AK67AK6w4l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7 v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF 1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIx AIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0D MIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIda VFxhVjvjDU0xZFpf9x0JUPnYwUUUUU= X-Originating-IP: [159.226.5.99] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCgUGA1z4jA6odQAAsx Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Xu Wang --- sound/soc/fsl/imx-audmix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index 202fb8950078..cbdc0a2c09c5 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -185,20 +185,20 @@ static int imx_audmix_probe(struct platform_device *pdev) return -ENOMEM; priv->num_dai = 2 * num_dai; - priv->dai = devm_kzalloc(&pdev->dev, priv->num_dai * + priv->dai = devm_kcalloc(&pdev->dev, priv->num_dai, sizeof(struct snd_soc_dai_link), GFP_KERNEL); if (!priv->dai) return -ENOMEM; priv->num_dai_conf = num_dai; - priv->dai_conf = devm_kzalloc(&pdev->dev, priv->num_dai_conf * + priv->dai_conf = devm_kcalloc(&pdev->dev, priv->num_dai_conf, sizeof(struct snd_soc_codec_conf), GFP_KERNEL); if (!priv->dai_conf) return -ENOMEM; priv->num_dapm_routes = 3 * num_dai; - priv->dapm_routes = devm_kzalloc(&pdev->dev, priv->num_dapm_routes * + priv->dapm_routes = devm_kcalloc(&pdev->dev, priv->num_dapm_routes, sizeof(struct snd_soc_dapm_route), GFP_KERNEL); if (!priv->dapm_routes) @@ -208,7 +208,7 @@ static int imx_audmix_probe(struct platform_device *pdev) struct snd_soc_dai_link_component *dlc; /* for CPU/Codec/Platform x 2 */ - dlc = devm_kzalloc(&pdev->dev, 6 * sizeof(*dlc), GFP_KERNEL); + dlc = devm_kcalloc(&pdev->dev, 6, sizeof(*dlc), GFP_KERNEL); if (!dlc) { dev_err(&pdev->dev, "failed to allocate dai_link\n"); return -ENOMEM; -- 2.17.1