ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc()
authorye xingchen <ye.xingchen@zte.com.cn>
Fri, 16 Sep 2022 06:20:27 +0000 (06:20 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 19 Sep 2022 16:52:40 +0000 (17:52 +0100)
Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/acp/acp-mach-common.c

index f0c49127aad11178770e2d186b8be62f50ea916d..4c69cb6e34006696044f585281931bfaa8e6f24e 100644 (file)
@@ -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;