Re: [PATCH 3/8] MIPS: sni: Replace deprecated strcpy() in sni_console_setup()
From: Justin Stitt
Date: Mon Aug 18 2025 - 19:45:13 EST
Hi,
On Sun, Aug 17, 2025 at 08:37:13PM +0200, Thorsten Blum wrote:
> strcpy() is deprecated; use strscpy() instead.
>
> Link: https://github.com/KSPP/linux/issues/88
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> arch/mips/sni/setup.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
> index 03cb69937258..fc7da12284f5 100644
> --- a/arch/mips/sni/setup.c
> +++ b/arch/mips/sni/setup.c
> @@ -13,6 +13,7 @@
> #include <linux/export.h>
> #include <linux/console.h>
> #include <linux/screen_info.h>
> +#include <linux/string.h>
This include isn't strictly necessary but I suppose it makes the
dependency explicit.
Reviewed-by: Justin Stitt <justinstitt@xxxxxxxxxx>
>
> #ifdef CONFIG_FW_ARC
> #include <asm/fw/arc/types.h>
> @@ -80,7 +81,7 @@ static void __init sni_console_setup(void)
> break;
> }
> if (baud)
> - strcpy(options, baud);
> + strscpy(options, baud);
> if (strncmp(cdev, "tty552", 6) == 0)
> add_preferred_console("ttyS", port,
> baud ? options : NULL);
> --
> 2.50.1
>
>
Thanks
Justin