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 <[email protected]> Reviewed-by: Cezary Rojewski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3cab1fc commit 6d9d666

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)