ALSA: atmel: Replace deprecated strcpy() with strscpy()
Subsystems (2)
PATCH 1/1 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.
Signed-off-by Thorsten Blum <[email protected]>
--- sound/atmel/ac97c.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/atmel/ac97c.c +5 -4
@@ -16,6 +16,7 @@#include <linux/module.h> #include <linux/platform_device.h> #include <linux/mutex.h> +#include <linux/string.h> #include <linux/types.h> #include <linux/io.h>
@@ -589,7 +590,7 @@ static int atmel_ac97c_pcm_new(struct atmel_ac97c *chip) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm = pcm;return 0 ;
@@ -748,9 +749,9 @@ static int atmel_ac97c_probe(struct platform_device *pdev)spin_lock_init (&chip->lock); -strcpy (card->driver,"Atmel AC97C" ); -strcpy (card->shortname,"Atmel AC97C" ); -sprintf (card->longname,"Atmel AC97 controller" ); +strscpy (card->driver,"Atmel AC97C" ); +strscpy (card->shortname,"Atmel AC97C" ); +strscpy (card->longname,"Atmel AC97 controller" ); chip->card = card; chip->pclk = pclk;
Signature · 1 line
2.49.0
Quoted 8 lines · Thorsten Blum
strcpy()is deprecated; usestrscpy()instead. Usestrscpy()to copy the long name because there's no string to format withsprintf().No functional changes intended.
Signed-off-by Thorsten Blum <[email protected]>
Applied now. Thanks.
Takashi