* [PATCH] ALSA: atmel: Replace deprecated strcpy() with strscpy()
@ 2025-05-22 18:01 Thorsten Blum
2025-05-22 18:37 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-05-22 18:01 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Uwe Kleine-König
Cc: Thorsten Blum, Takashi Iwai, linux-sound, linux-arm-kernel,
linux-kernel
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 <thorsten.blum@linux.dev>
---
sound/atmel/ac97c.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 84e264f335ca..693d48f08b88 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -16,6 +16,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
+#include <linux/string.h>
#include <linux/types.h>
#include <linux/io.h>
@@ -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;
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: atmel: Replace deprecated strcpy() with strscpy()
2025-05-22 18:01 [PATCH] ALSA: atmel: Replace deprecated strcpy() with strscpy() Thorsten Blum
@ 2025-05-22 18:37 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-05-22 18:37 UTC (permalink / raw)
To: Thorsten Blum
Cc: Jaroslav Kysela, Takashi Iwai, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Uwe Kleine-König, Takashi Iwai, linux-sound,
linux-arm-kernel, linux-kernel
On Thu, 22 May 2025 20:01:09 +0200,
Thorsten Blum wrote:
>
> 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 <thorsten.blum@linux.dev>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-22 18:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 18:01 [PATCH] ALSA: atmel: Replace deprecated strcpy() with strscpy() Thorsten Blum
2025-05-22 18:37 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).