Skip to content

Commit cd24bdb

Browse files
ytcoodemhiramat
authored andcommitted
init/main.c: Remove redundant space from saved_command_line
There is a space at the end of extra_init_args. In the current logic, copying extra_init_args to saved_command_line will cause extra spaces in saved_command_line here or there. Remove the trailing space from extra_init_args to make the string in saved_command_line look more perfect. Link: https://lore.kernel.org/all/20240412032950.12687-1-ytcoode@gmail.com/ Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent efee03a commit cd24bdb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

init/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,10 @@ static void __init setup_command_line(char *command_line)
628628

629629
if (extra_command_line)
630630
xlen = strlen(extra_command_line);
631-
if (extra_init_args)
631+
if (extra_init_args) {
632+
extra_init_args = strim(extra_init_args); /* remove trailing space */
632633
ilen = strlen(extra_init_args) + 4; /* for " -- " */
634+
}
633635

634636
len = xlen + strlen(boot_command_line) + 1;
635637

0 commit comments

Comments
 (0)