From: ye xingchen Date: Fri, 16 Sep 2022 06:20:27 +0000 (+0000) Subject: ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc() X-Git-Tag: v6.1-rc5~4^2~17^2~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f047199e6f3115896fee25ac8809e1a9a8c948fc;p=platform%2Fkernel%2Flinux-starfive.git ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Reported-by: Zeal Robot Signed-off-by: ye xingchen Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown --- diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c index f0c4912..4c69cb6 100644 --- a/sound/soc/amd/acp/acp-mach-common.c +++ b/sound/soc/amd/acp/acp-mach-common.c @@ -584,7 +584,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) if (drv_data->dmic_cpu_id) num_links++; - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_links, GFP_KERNEL); + links = devm_kcalloc(dev, num_links, sizeof(struct snd_soc_dai_link), GFP_KERNEL); if (!links) return -ENOMEM; @@ -749,7 +749,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) if (drv_data->dmic_cpu_id) num_links++; - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_links, GFP_KERNEL); + links = devm_kcalloc(dev, num_links, sizeof(struct snd_soc_dai_link), GFP_KERNEL); if (!links) return -ENOMEM;