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

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: sb: 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/20250512105754.35595-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Thorsten Blum and committed by
Takashi Iwai
e088806c 174d9664

+16 -10
+2 -1
sound/isa/sb/emu8000.c
··· 14 14 #include <linux/export.h> 15 15 #include <linux/delay.h> 16 16 #include <linux/io.h> 17 + #include <linux/string.h> 17 18 #include <sound/core.h> 18 19 #include <sound/emu8000.h> 19 20 #include <sound/emu8000_reg.h> ··· 1097 1096 #if IS_ENABLED(CONFIG_SND_SEQUENCER) 1098 1097 if (snd_seq_device_new(card, index, SNDRV_SEQ_DEV_ID_EMU8000, 1099 1098 sizeof(struct snd_emu8000*), &awe) >= 0) { 1100 - strcpy(awe->name, "EMU-8000"); 1099 + strscpy(awe->name, "EMU-8000"); 1101 1100 *(struct snd_emu8000 **)SNDRV_SEQ_DEVICE_ARGPTR(awe) = hw; 1102 1101 } 1103 1102 #else
+3 -2
sound/isa/sb/jazz16.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/io.h> 17 17 #include <linux/delay.h> 18 + #include <linux/string.h> 18 19 #include <asm/dma.h> 19 20 #include <linux/isa.h> 20 21 #include <sound/core.h> ··· 287 286 288 287 jazz16->chip = chip; 289 288 290 - strcpy(card->driver, "jazz16"); 291 - strcpy(card->shortname, "Media Vision Jazz16"); 289 + strscpy(card->driver, "jazz16"); 290 + strscpy(card->shortname, "Media Vision Jazz16"); 292 291 sprintf(card->longname, 293 292 "Media Vision Jazz16 at 0x%lx, irq %d, dma8 %d, dma16 %d", 294 293 port[dev], xirq, xdma8, xdma16);
+3 -2
sound/isa/sb/sb16.c
··· 10 10 #include <linux/err.h> 11 11 #include <linux/isa.h> 12 12 #include <linux/module.h> 13 + #include <linux/string.h> 13 14 #include <sound/core.h> 14 15 #include <sound/sb.h> 15 16 #include <sound/sb16_csp.h> ··· 338 337 if (err < 0) 339 338 return err; 340 339 341 - strcpy(card->driver, 340 + strscpy(card->driver, 342 341 #ifdef SNDRV_SBAWE_EMU8000 343 342 awe_port[dev] > 0 ? "SB AWE" : 344 343 #endif 345 344 "SB16"); 346 - strcpy(card->shortname, chip->name); 345 + strscpy(card->shortname, chip->name); 347 346 sprintf(card->longname, "%s at 0x%lx, irq %i, dma ", 348 347 chip->name, 349 348 chip->port,
+3 -2
sound/isa/sb/sb8.c
··· 9 9 #include <linux/isa.h> 10 10 #include <linux/ioport.h> 11 11 #include <linux/module.h> 12 + #include <linux/string.h> 12 13 #include <sound/core.h> 13 14 #include <sound/sb.h> 14 15 #include <sound/opl3.h> ··· 163 162 if (err < 0) 164 163 return err; 165 164 166 - strcpy(card->driver, chip->hardware == SB_HW_PRO ? "SB Pro" : "SB8"); 167 - strcpy(card->shortname, chip->name); 165 + strscpy(card->driver, chip->hardware == SB_HW_PRO ? "SB Pro" : "SB8"); 166 + strscpy(card->shortname, chip->name); 168 167 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", 169 168 chip->name, 170 169 chip->port,
+2 -1
sound/isa/sb/sb8_midi.c
··· 14 14 */ 15 15 16 16 #include <linux/io.h> 17 + #include <linux/string.h> 17 18 #include <linux/time.h> 18 19 #include <sound/core.h> 19 20 #include <sound/sb.h> ··· 255 254 err = snd_rawmidi_new(chip->card, "SB8 MIDI", device, 1, 1, &rmidi); 256 255 if (err < 0) 257 256 return err; 258 - strcpy(rmidi->name, "SB8 MIDI"); 257 + strscpy(rmidi->name, "SB8 MIDI"); 259 258 snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_sb8dsp_midi_output); 260 259 snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_sb8dsp_midi_input); 261 260 rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT;
+3 -2
sound/isa/sb/sb_mixer.c
··· 6 6 7 7 #include <linux/io.h> 8 8 #include <linux/delay.h> 9 + #include <linux/string.h> 9 10 #include <linux/time.h> 10 11 #include <sound/core.h> 11 12 #include <sound/sb.h> ··· 719 718 return err; 720 719 } 721 720 snd_component_add(card, name); 722 - strcpy(card->mixername, name); 721 + strscpy(card->mixername, name); 723 722 return 0; 724 723 } 725 724 ··· 800 799 return err; 801 800 break; 802 801 default: 803 - strcpy(card->mixername, "???"); 802 + strscpy(card->mixername, "???"); 804 803 } 805 804 return 0; 806 805 }