From: ye xingchen Date: Fri, 16 Sep 2022 06:25:11 +0000 (+0000) Subject: ASOC: SOF: use devm_kcalloc() instead of devm_kzalloc() X-Git-Tag: v6.1-rc5~4^2~17^2~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b88552c26971ccbc6ff35e9d544f7fac94ffef1;p=platform%2Fkernel%2Flinux-starfive.git ASOC: SOF: use 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 Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220916062511.153962-1-ye.xingchen@zte.com.cn Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c index 356497f..3537805 100644 --- a/sound/soc/sof/nocodec.c +++ b/sound/soc/sof/nocodec.c @@ -32,7 +32,7 @@ static int sof_nocodec_bes_setup(struct device *dev, /* set up BE dai_links */ for (i = 0; i < link_num; i++) { - dlc = devm_kzalloc(dev, 3 * sizeof(*dlc), GFP_KERNEL); + dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL); if (!dlc) return -ENOMEM; @@ -78,7 +78,7 @@ static int sof_nocodec_setup(struct device *dev, struct snd_soc_dai_link *links; /* create dummy BE dai_links */ - links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL); + links = devm_kcalloc(dev, num_dai_drivers, sizeof(struct snd_soc_dai_link), GFP_KERNEL); if (!links) return -ENOMEM;