Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250522180111.12144-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Thorsten Blum and committed by
Takashi Iwai
b80a6117 d18bbb7b

+5 -4
+5 -4
sound/atmel/ac97c.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/mutex.h> 19 + #include <linux/string.h> 19 20 #include <linux/types.h> 20 21 #include <linux/io.h> 21 22 ··· 590 589 591 590 pcm->private_data = chip; 592 591 pcm->info_flags = 0; 593 - strcpy(pcm->name, chip->card->shortname); 592 + strscpy(pcm->name, chip->card->shortname); 594 593 chip->pcm = pcm; 595 594 596 595 return 0; ··· 749 748 750 749 spin_lock_init(&chip->lock); 751 750 752 - strcpy(card->driver, "Atmel AC97C"); 753 - strcpy(card->shortname, "Atmel AC97C"); 754 - sprintf(card->longname, "Atmel AC97 controller"); 751 + strscpy(card->driver, "Atmel AC97C"); 752 + strscpy(card->shortname, "Atmel AC97C"); 753 + strscpy(card->longname, "Atmel AC97 controller"); 755 754 756 755 chip->card = card; 757 756 chip->pclk = pclk;