[PATCH 0/4] ASoC: Intel: avs: move devm_kzalloc(..., size * n, ...) to devm_kcalloc

From: Ethan Carter Edwards
Date: Fri Mar 14 2025 - 10:39:32 EST


Open coded arithmetic in allocator arguments is discouraged. Helper
functions like kcalloc or, in this case, devm_kcalloc are preferred. Not
only for readability purposes but safety purposes.

The changes move `devm_kzalloc(dev, sizeof(var) * n, GFP_KERNEL)` to
the helper function `devm_kcalloc(dev, n, sizeof(var), GFP_KERNEL)`.

Here is a series of four patches within the Intel/avs drivers that make
these changes. They are all compile tested only but should have no
effect on runtime behaviour.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://github.com/KSPP/linux/issues/162

Signed-off-by: Ethan Carter Edwards <ethan@xxxxxxxxxxxxxxxxx>
---
Ethan Carter Edwards (4):
ASoC: Intel: avs: move devm_kzalloc(..., size * n, ...) to devm_kcalloc
ASoC: Intel: ssm4567: move devm_kzalloc(..., size * n, ...) to devm_kcalloc
ASoC: Intel: max98373: move devm_kzalloc(..., size * n, ...) to devm_kcalloc
ASoC: Intel: max98927: move devm_kzalloc(..., size * n, ...) to devm_kcalloc

sound/soc/intel/avs/boards/max98373.c | 2 +-
sound/soc/intel/avs/boards/max98927.c | 2 +-
sound/soc/intel/avs/boards/ssm4567.c | 2 +-
sound/soc/intel/avs/pcm.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: da920b7df701770e006928053672147075587fb2
change-id: 20250314-sound-avs-kcalloc-91cedbc47074

Best regards,
--
Ethan Carter Edwards <ethan@xxxxxxxxxxxxxxxxx>