Skip to content

Commit 7e99a4a

Browse files
tobluxmaddy-kerneldev
authored andcommitted
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. Link: KSPP#88 Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent d36e3f1 commit 7e99a4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/powerpc/kernel/proc_powerpc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/proc_fs.h>
1010
#include <linux/kernel.h>
1111
#include <linux/of.h>
12+
#include <linux/string.h>
1213

1314
#include <asm/machdep.h>
1415
#include <asm/vdso_datapage.h>
@@ -56,7 +57,7 @@ static int __init proc_ppc64_init(void)
5657
{
5758
struct proc_dir_entry *pde;
5859

59-
strcpy((char *)systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
60+
strscpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
6061
systemcfg->version.major = SYSTEMCFG_MAJOR;
6162
systemcfg->version.minor = SYSTEMCFG_MINOR;
6263
systemcfg->processor = mfspr(SPRN_PVR);

0 commit comments

Comments
 (0)