mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: tas2781: Replace deprecated strcpy() with strscpy()
@ 2025-11-04  5:42 hariconscious
  2025-11-05 11:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: hariconscious @ 2025-11-04  5:42 UTC (permalink / raw)
  To: shenghao-ding, kevin-lu, baojun.xu, lgirdwood, broonie, perex, tiwai
  Cc: khalid, shuah, david.hunter.linux, linux-sound, linux-kernel,
	HariKrishna Sagala

From: HariKrishna Sagala <hariconscious@gmail.com>

strcpy() is deprecated,use strscpy() instead.
No functional changes intended.
Link: https://github.com/KSPP/linux/issues/88

Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
---
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: tas2781: Replace deprecated strcpy() with strscpy()
  2025-11-04  5:42 [PATCH] ASoC: tas2781: Replace deprecated strcpy() with strscpy() hariconscious
@ 2025-11-05 11:43 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-11-05 11:43 UTC (permalink / raw)
  To: shenghao-ding, kevin-lu, baojun.xu, lgirdwood, perex, tiwai,
	hariconscious
  Cc: khalid, shuah, david.hunter.linux, linux-sound, linux-kernel

On Tue, 04 Nov 2025 11:12:58 +0530, hariconscious@gmail.com wrote:
> strcpy() is deprecated,use strscpy() instead.
> No functional changes intended.
> Link: https://github.com/KSPP/linux/issues/88
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tas2781: Replace deprecated strcpy() with strscpy()
      commit: 3b071bdd26849172101081573a18022af108fb21

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-05 11:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-04  5:42 [PATCH] ASoC: tas2781: Replace deprecated strcpy() with strscpy() hariconscious
2025-11-05 11:43 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®