[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240412081733.35925-3-ytcoode@gmail.com>
Date: Fri, 12 Apr 2024 16:17:33 +0800
From: Yuntao Wang <ytcoode@...il.com>
To: mhiramat@...nel.org
Cc: akpm@...ux-foundation.org,
arnd@...db.de,
christophe.leroy@...roup.eu,
geert@...ux-m68k.org,
jpoimboe@...nel.org,
kjlx@...pleofstupid.com,
linux-kernel@...r.kernel.org,
ndesaulniers@...gle.com,
peterz@...radead.org,
rppt@...nel.org,
tglx@...utronix.de,
tj@...nel.org,
ytcoode@...il.com
Subject: [PATCH v2 2/2] 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.
Signed-off-by: Yuntao Wang <ytcoode@...il.com>
---
init/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/init/main.c b/init/main.c
index 5dcf5274c09c..d6383e397e9f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -630,11 +630,11 @@ static void __init setup_command_line(char *command_line)
if (extra_init_args)
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;
--
2.44.0
Powered by blists - more mailing lists