diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-06-30 13:09:44 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-06-30 14:08:32 +0200 |
| commit | 66b338d006d75ab52b16bf05a7f4f451043199bf (patch) | |
| tree | b4b73c813f45c579acf699bb23044c451b405ccb /sound/drivers | |
| parent | 24ffcf7f27cf75389ca550a18f9e45a8dad27bd2 (diff) | |
ALSA: dummy: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead.
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/20250630110945.2225-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
| -rw-r--r-- | sound/drivers/dummy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 783fe3a22bc9..6dac0b2523c1 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -9,6 +9,7 @@ #include <linux/platform_device.h> #include <linux/jiffies.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/hrtimer.h> @@ -684,7 +685,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device, snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, ops); pcm->private_data = dummy; pcm->info_flags = 0; - strcpy(pcm->name, "Dummy PCM"); + strscpy(pcm->name, "Dummy PCM"); if (!fake_buffer) { snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, @@ -875,7 +876,7 @@ static int snd_card_dummy_new_mixer(struct snd_dummy *dummy) int err; spin_lock_init(&dummy->mixer_lock); - strcpy(card->mixername, "Dummy Mixer"); + strscpy(card->mixername, "Dummy Mixer"); dummy->iobox = 1; for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) { @@ -1083,8 +1084,8 @@ static int snd_dummy_probe(struct platform_device *devptr) err = snd_card_dummy_new_mixer(dummy); if (err < 0) return err; - strcpy(card->driver, "Dummy"); - strcpy(card->shortname, "Dummy"); + strscpy(card->driver, "Dummy"); + strscpy(card->shortname, "Dummy"); sprintf(card->longname, "Dummy %i", dev + 1); dummy_proc_init(dummy); |