Skip to content

Commit

Permalink
MIPS: Make builtin_cmdline const & variable length
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
  • Loading branch information
paulburton committed Oct 12, 2019
1 parent 9727277 commit 9dd422f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dd422f

Please sign in to comment.