mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
ALSA: sh: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to arrays. Only idiomatic code replacement, and no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250710100727.22653-92-tiwai@suse.de
This commit is contained in:
parent
292e4adb95
commit
61d4db8f7c
@ -424,7 +424,7 @@ static int __init snd_aicapcmchip(struct snd_card_aica
|
|||||||
if (unlikely(err < 0))
|
if (unlikely(err < 0))
|
||||||
return err;
|
return err;
|
||||||
pcm->private_data = dreamcastcard;
|
pcm->private_data = dreamcastcard;
|
||||||
strcpy(pcm->name, "AICA PCM");
|
strscpy(pcm->name, "AICA PCM");
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
|
||||||
&snd_aicapcm_playback_ops);
|
&snd_aicapcm_playback_ops);
|
||||||
/* Allocate the DMA buffers */
|
/* Allocate the DMA buffers */
|
||||||
@ -568,9 +568,9 @@ static int snd_aica_probe(struct platform_device *devptr)
|
|||||||
kfree(dreamcastcard);
|
kfree(dreamcastcard);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
strcpy(dreamcastcard->card->driver, "snd_aica");
|
strscpy(dreamcastcard->card->driver, "snd_aica");
|
||||||
strcpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
|
strscpy(dreamcastcard->card->shortname, SND_AICA_DRIVER);
|
||||||
strcpy(dreamcastcard->card->longname,
|
strscpy(dreamcastcard->card->longname,
|
||||||
"Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast");
|
"Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast");
|
||||||
/* Prepare to use the queue */
|
/* Prepare to use the queue */
|
||||||
INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma);
|
INIT_WORK(&(dreamcastcard->spu_dma_work), run_spu_dma);
|
||||||
|
@ -224,7 +224,7 @@ static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
pcm->private_data = chip;
|
pcm->private_data = chip;
|
||||||
strcpy(pcm->name, "SH_DAC PCM");
|
strscpy(pcm->name, "SH_DAC PCM");
|
||||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sh_dac_pcm_ops);
|
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sh_dac_pcm_ops);
|
||||||
|
|
||||||
/* buffer size=48K */
|
/* buffer size=48K */
|
||||||
@ -358,8 +358,8 @@ static int snd_sh_dac_probe(struct platform_device *devptr)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto probe_error;
|
goto probe_error;
|
||||||
|
|
||||||
strcpy(card->driver, "snd_sh_dac");
|
strscpy(card->driver, "snd_sh_dac");
|
||||||
strcpy(card->shortname, "SuperH DAC audio driver");
|
strscpy(card->shortname, "SuperH DAC audio driver");
|
||||||
dev_info(&devptr->dev, "%s %s\n", card->longname, card->shortname);
|
dev_info(&devptr->dev, "%s %s\n", card->longname, card->shortname);
|
||||||
|
|
||||||
err = snd_card_register(card);
|
err = snd_card_register(card);
|
||||||
|
Loading…
Reference in New Issue
Block a user