From: Raag Jadav Date: Fri, 28 Feb 2025 06:28:09 +0000 (+0530) Subject: ASoC: tlv320dac33: use devm_kmemdup_array() X-Git-Tag: v6.15-rc1~173^2~4^2~79^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69aaab0e65e9bd7601740c1e14cc6de86dafb621;p=thirdparty%2Flinux.git ASoC: tlv320dac33: use devm_kmemdup_array() Convert to use devm_kmemdup_array() and while at it, make the size robust against type changes. Signed-off-by: Raag Jadav Link: https://patch.msgid.link/20250228062812.150004-4-raag.jadav@intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index fa46f51d4341e..423b9264a205e 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -1477,10 +1477,8 @@ static int dac33_i2c_probe(struct i2c_client *client) if (dac33 == NULL) return -ENOMEM; - dac33->reg_cache = devm_kmemdup(&client->dev, - dac33_reg, - ARRAY_SIZE(dac33_reg) * sizeof(u8), - GFP_KERNEL); + dac33->reg_cache = devm_kmemdup_array(&client->dev, dac33_reg, ARRAY_SIZE(dac33_reg), + sizeof(dac33_reg[0]), GFP_KERNEL); if (!dac33->reg_cache) return -ENOMEM;