Skip to content

Commit b80a611

Browse files
tobluxtiwai
authored andcommitted
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: KSPP#88 Signed-off-by: Thorsten Blum <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent d18bbb7 commit b80a611

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sound/atmel/ac97c.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/module.h>
1717
#include <linux/platform_device.h>
1818
#include <linux/mutex.h>
19+
#include <linux/string.h>
1920
#include <linux/types.h>
2021
#include <linux/io.h>
2122

@@ -589,7 +590,7 @@ static int atmel_ac97c_pcm_new(struct atmel_ac97c *chip)
589590

590591
pcm->private_data = chip;
591592
pcm->info_flags = 0;
592-
strcpy(pcm->name, chip->card->shortname);
593+
strscpy(pcm->name, chip->card->shortname);
593594
chip->pcm = pcm;
594595

595596
return 0;
@@ -748,9 +749,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev)
748749

749750
spin_lock_init(&chip->lock);
750751

751-
strcpy(card->driver, "Atmel AC97C");
752-
strcpy(card->shortname, "Atmel AC97C");
753-
sprintf(card->longname, "Atmel AC97 controller");
752+
strscpy(card->driver, "Atmel AC97C");
753+
strscpy(card->shortname, "Atmel AC97C");
754+
strscpy(card->longname, "Atmel AC97 controller");
754755

755756
chip->card = card;
756757
chip->pclk = pclk;

0 commit comments

Comments
 (0)