powerpc: Replace strcpy() with strscpy() in proc_ppc64_init()
PATCH 1/1 powerpc: Replace strcpy() with strscpy() in proc_ppc64_init()
strcpy() is deprecated; use strscpy() instead.
Don't cast the destination buffer from 'u8[]' to 'char *' to satisfy the __must_be_array() requirement of strscpy().
No functional changes intended.
Signed-off-by Thorsten Blum <[email protected]>
--- arch/powerpc/kernel/proc_powerpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/proc_powerpc.c +2 -1
@@ -9,6 +9,7 @@#include <linux/proc_fs.h> #include <linux/kernel.h> #include <linux/of.h> +#include <linux/string.h> #include <asm/machdep.h> #include <asm/vdso_datapage.h>
@@ -56,7 +57,7 @@ static int __init proc_ppc64_init(void) {struct proc_dir_entry *pde; -strcpy ((char *)systemcfg->eye_catcher,"SYSTEMCFG:PPC64" ); +strscpy (systemcfg->eye_catcher,"SYSTEMCFG:PPC64" ); systemcfg->version.major =SYSTEMCFG_MAJOR ; systemcfg->version.minor =SYSTEMCFG_MINOR ; systemcfg->processor =mfspr (SPRN_PVR );
Signature · 1 line
2.49.0
Quoted 8 lines · Thorsten Blum
strcpy()is deprecated; usestrscpy()instead.Don't cast the destination buffer from 'u8[]' to 'char *' to satisfy the
__must_be_array()requirement ofstrscpy().No functional changes intended.
[...]
Applied to powerpc/next.
[1/1] powerpc: Replace strcpy() with strscpy() in proc_ppc64_init()
https://git.kernel.org/powerpc/c/7e99a4a60d8fc9b24a3f9632011bf7e197f1aff9
Thanks