summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorYuntao Wang <ytcoode@gmail.com>2024-04-12 10:17:33 +0200
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2024-04-12 18:03:13 +0200
commitddd53363f875eb23b6754362ce0a43f2214f0a83 (patch)
treee990f82ef077c9b9b33183318b380494575e407c /init
parentinit/main.c: Remove redundant space from saved_command_line (diff)
downloadlinux-ddd53363f875eb23b6754362ce0a43f2214f0a83.tar.xz
linux-ddd53363f875eb23b6754362ce0a43f2214f0a83.zip
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>
Diffstat (limited to 'init')
-rw-r--r--init/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/init/main.c b/init/main.c
index 02156c3c5879..383796015113 100644
--- a/init/main.c
+++ b/init/main.c
@@ -633,11 +633,11 @@ static void __init setup_command_line(char *command_line)
ilen = strlen(extra_init_args) + 4; /* for " -- " */
}
- len = xlen + strlen(boot_command_line) + 1;
+ len = xlen + strlen(boot_command_line) + ilen + 1;
- saved_command_line = memblock_alloc(len + ilen, SMP_CACHE_BYTES);
+ saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
if (!saved_command_line)
- panic("%s: Failed to allocate %zu bytes\n", __func__, len + ilen);
+ panic("%s: Failed to allocate %zu bytes\n", __func__, len);
len = xlen + strlen(command_line) + 1;