Skip to content

Commit 3602571

Browse files
ethancedwards8broonie
authored andcommitted
ASoC: Intel: avs: max98927: Replace devm_kzalloc() with devm_kcalloc()
Open coded arithmetic in allocator arguments is discouraged [1]. Helper functions like kcalloc or, in this case, devm_kcalloc are preferred. [1]: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20250317-sound-avs-kcalloc-v2-4-20e2a132b18f@ethancedwards.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bde4796 commit 3602571

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/intel/avs/boards/max98927.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
108108
dl->name = devm_kasprintf(dev, GFP_KERNEL,
109109
AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot));
110110
dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL);
111-
dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs) * 2, GFP_KERNEL);
111+
dl->codecs = devm_kcalloc(dev, 2, sizeof(*dl->codecs), GFP_KERNEL);
112112
if (!dl->name || !dl->cpus || !dl->codecs)
113113
return -ENOMEM;
114114

0 commit comments

Comments
 (0)