diff mbox series

[3/3] MIPS: Make builtin_cmdline const & variable length

Message ID 20191012204326.2564623-3-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit 9dd422f69777b928f8a12e5392d4aeeb00a55c2b
Delegated to: Paul Burton
Headers show
Series [1/3] MIPS: Always define builtin_cmdline | expand

Commit Message

Paul Burton Oct. 12, 2019, 8:43 p.m. UTC
We have no need for the builtin_cmdline array to be fixed at the length
of COMMAND_LINE_SIZE - we'll only copy out the string it contains up to
its NULL terminator anyway, and cap the size at COMMAND_LINE_SIZE when
copying into or concatenating with boot_command_line.

The string value is also constant, so we can declare it as such to place
it in the .init.rodata section.

Signed-off-by: Paul Burton <paul.burton@mips.com>
---

 arch/mips/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 7ccc8a9e1bfe..2af05879772f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -67,7 +67,7 @@  static char __initdata command_line[COMMAND_LINE_SIZE];
 char __initdata arcs_cmdline[COMMAND_LINE_SIZE];
 
 #ifdef CONFIG_CMDLINE_BOOL
-static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
+static const char builtin_cmdline[] __initconst = CONFIG_CMDLINE;
 #else
 static const char builtin_cmdline[] __initconst = "";
 #endif