Skip to content

Commit bde4796

Browse files
ethancedwards8broonie
authored andcommitted
ASoC: Intel: avs: max98373: 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 61b1a1b commit bde4796

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

0 commit comments

Comments
 (0)