[PATCH] ASoC: tas2781: Replace deprecated strcpy() with strscpy()
From: hariconscious
Date: Tue Nov 04 2025 - 00:48:58 EST
From: HariKrishna Sagala <hariconscious@xxxxxxxxx>
strcpy() is deprecated,use strscpy() instead.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: HariKrishna Sagala <hariconscious@xxxxxxxxx>
---
This patch replaces strcpy() call with the strscpy() API.
strscpy() is preferred over strcpy()/strncpy() as per the
kernel documentation.
If padding is fine, will use strscpy_pad() API.
Please let me know, will modify patch accordingly.
Thank you.
sound/soc/codecs/tas2781-i2c.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c
index ba880b5de7e8..0f314523703f 100644
--- a/sound/soc/codecs/tas2781-i2c.c
+++ b/sound/soc/codecs/tas2781-i2c.c
@@ -1999,7 +1999,8 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
dev_err(tas_priv->dev, "%s Can't get reset GPIO\n",
__func__);
- strcpy(tas_priv->dev_name, tasdevice_id[tas_priv->chip_id].name);
+ strscpy(tas_priv->dev_name, tasdevice_id[tas_priv->chip_id].name,
+ sizeof(tas_priv->dev_name));
}
static int tasdevice_i2c_probe(struct i2c_client *i2c)
base-commit: d127176862a93c4b3216bda533d2bee170af5e71
--
2.43.0