Skip to content

Commit 6d9d666

Browse files
ethancedwards8broonie
authored andcommitted
ASoC: Intel: avs: 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-1-20e2a132b18f@ethancedwards.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3cab1fc commit 6d9d666

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/intel/avs/pcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ int avs_i2s_platform_register(struct avs_dev *adev, const char *name, unsigned l
13801380
for_each_set_bit(i, &port_mask, ssp_count)
13811381
cpu_count += hweight_long(tdms[i]);
13821382

1383-
cpus = devm_kzalloc(adev->dev, sizeof(*cpus) * cpu_count, GFP_KERNEL);
1383+
cpus = devm_kcalloc(adev->dev, cpu_count, sizeof(*cpus), GFP_KERNEL);
13841384
if (!cpus)
13851385
return -ENOMEM;
13861386

0 commit comments

Comments
 (0)