Commit 877336c1 authored by Wolfram Sang's avatar Wolfram Sang Committed by Thomas Bogendoerfer

MIPS: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent edeed424
...@@ -26,7 +26,7 @@ __init void mips_set_machine_name(const char *name) ...@@ -26,7 +26,7 @@ __init void mips_set_machine_name(const char *name)
if (name == NULL) if (name == NULL)
return; return;
strlcpy(mips_machine_name, name, sizeof(mips_machine_name)); strscpy(mips_machine_name, name, sizeof(mips_machine_name));
pr_info("MIPS: machine is %s\n", mips_get_machine_name()); pr_info("MIPS: machine is %s\n", mips_get_machine_name());
} }
...@@ -52,9 +52,9 @@ int __init __dt_register_buses(const char *bus0, const char *bus1) ...@@ -52,9 +52,9 @@ int __init __dt_register_buses(const char *bus0, const char *bus1)
if (!of_have_populated_dt()) if (!of_have_populated_dt())
panic("device tree not present"); panic("device tree not present");
strlcpy(of_ids[0].compatible, bus0, sizeof(of_ids[0].compatible)); strscpy(of_ids[0].compatible, bus0, sizeof(of_ids[0].compatible));
if (bus1) { if (bus1) {
strlcpy(of_ids[1].compatible, bus1, strscpy(of_ids[1].compatible, bus1,
sizeof(of_ids[1].compatible)); sizeof(of_ids[1].compatible));
} }
......
...@@ -340,7 +340,7 @@ void *__init relocate_kernel(void) ...@@ -340,7 +340,7 @@ void *__init relocate_kernel(void)
early_init_dt_scan(fdt); early_init_dt_scan(fdt);
if (boot_command_line[0]) { if (boot_command_line[0]) {
/* Boot command line was passed in device tree */ /* Boot command line was passed in device tree */
strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
} }
#endif /* CONFIG_USE_OF */ #endif /* CONFIG_USE_OF */
......
...@@ -44,7 +44,7 @@ void __init plat_mem_setup(void) ...@@ -44,7 +44,7 @@ void __init plat_mem_setup(void)
pr_info(" builtin_cmdline : %s\n", CONFIG_CMDLINE); pr_info(" builtin_cmdline : %s\n", CONFIG_CMDLINE);
#endif #endif
if (dtb != __dtb_start) if (dtb != __dtb_start)
strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
#ifdef CONFIG_EARLY_PRINTK #ifdef CONFIG_EARLY_PRINTK
fw_init_early_console(-1); fw_init_early_console(-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment