Skip to content

Commit ddd5336

Browse files
ytcoodemhiramat
authored andcommitted
init/main.c: Minor cleanup for the setup_command_line() function
This is just a minor cleanup to make the code look a bit cleaner. Link: https://lore.kernel.org/all/20240412081733.35925-3-ytcoode@gmail.com/ Signed-off-by: Yuntao Wang <ytcoode@gmail.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent cd24bdb commit ddd5336

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,11 @@ static void __init setup_command_line(char *command_line)
633633
ilen = strlen(extra_init_args) + 4; /* for " -- " */
634634
}
635635

636-
len = xlen + strlen(boot_command_line) + 1;
636+
len = xlen + strlen(boot_command_line) + ilen + 1;
637637

638-
saved_command_line = memblock_alloc(len + ilen, SMP_CACHE_BYTES);
638+
saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
639639
if (!saved_command_line)
640-
panic("%s: Failed to allocate %zu bytes\n", __func__, len + ilen);
640+
panic("%s: Failed to allocate %zu bytes\n", __func__, len);
641641

642642
len = xlen + strlen(command_line) + 1;
643643

0 commit comments

Comments
 (0)