From: Thorsten Blum Date: Thu, 22 May 2025 18:01:09 +0000 (+0200) Subject: ALSA: atmel: Replace deprecated strcpy() with strscpy() X-Git-Tag: v6.16-rc1~170^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b80a61173d08e10b502578cbcb7a55febeff983b;p=thirdparty%2Fkernel%2Flinux.git ALSA: atmel: Replace deprecated strcpy() with strscpy() strcpy() is deprecated; use strscpy() instead. Use strscpy() to copy the long name because there's no string to format with sprintf(). No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20250522180111.12144-2-thorsten.blum@linux.dev Signed-off-by: Takashi Iwai --- diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 84e264f335ca9..693d48f08b88b 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -589,7 +590,7 @@ static int atmel_ac97c_pcm_new(struct atmel_ac97c *chip) pcm->private_data = chip; pcm->info_flags = 0; - strcpy(pcm->name, chip->card->shortname); + strscpy(pcm->name, chip->card->shortname); chip->pcm = pcm; return 0; @@ -748,9 +749,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev) spin_lock_init(&chip->lock); - strcpy(card->driver, "Atmel AC97C"); - strcpy(card->shortname, "Atmel AC97C"); - sprintf(card->longname, "Atmel AC97 controller"); + strscpy(card->driver, "Atmel AC97C"); + strscpy(card->shortname, "Atmel AC97C"); + strscpy(card->longname, "Atmel AC97 controller"); chip->card = card; chip->pclk = pclk;