Skip to content

Commit 2bae25a

Browse files
Siddarth Gundutiwai
authored andcommitted
ALSA: amd7930: replace strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead. Both the destination and source buffer are of fixed length so strscpy with 2-arguments is used. No functional changes intended. Link: KSPP#88 Signed-off-by: Siddarth Gundu <siddarthsgml@gmail.com> Link: https://patch.msgid.link/20250520113012.70270-1-siddarthsgml@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 0718a78 commit 2bae25a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sound/sparc/amd7930.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/of.h>
4040
#include <linux/platform_device.h>
4141
#include <linux/io.h>
42+
#include <linux/string.h>
4243

4344
#include <sound/core.h>
4445
#include <sound/pcm.h>
@@ -754,7 +755,7 @@ static int snd_amd7930_pcm(struct snd_amd7930 *amd)
754755

755756
pcm->private_data = amd;
756757
pcm->info_flags = 0;
757-
strcpy(pcm->name, amd->card->shortname);
758+
strscpy(pcm->name, amd->card->shortname);
758759
amd->pcm = pcm;
759760

760761
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
@@ -874,7 +875,7 @@ static int snd_amd7930_mixer(struct snd_amd7930 *amd)
874875
return -EINVAL;
875876

876877
card = amd->card;
877-
strcpy(card->mixername, card->shortname);
878+
strscpy(card->mixername, card->shortname);
878879

879880
for (idx = 0; idx < ARRAY_SIZE(amd7930_controls); idx++) {
880881
if ((err = snd_ctl_add(card,
@@ -1007,8 +1008,8 @@ static int amd7930_sbus_probe(struct platform_device *op)
10071008
if (err < 0)
10081009
return err;
10091010

1010-
strcpy(card->driver, "AMD7930");
1011-
strcpy(card->shortname, "Sun AMD7930");
1011+
strscpy(card->driver, "AMD7930");
1012+
strscpy(card->shortname, "Sun AMD7930");
10121013
sprintf(card->longname, "%s at 0x%02lx:0x%08Lx, irq %d",
10131014
card->shortname,
10141015
rp->flags & 0xffL,

0 commit comments

Comments
 (0)