[PATCH 2/3] init: Use bool for done flag in parse_early_param()
From: Thorsten Blum
Date: Fri Dec 04 2026 - 17:16:18 EST
The local variable done only stores a boolean value, so make it bool.
Also omit the explicit size argument to strscpy(), which uses the size
of the destination array.
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
init/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/init/main.c b/init/main.c
index c1e5daa8b52e..62d37017e455 100644
--- a/init/main.c
+++ b/init/main.c
@@ -827,16 +827,16 @@ void __init parse_early_options(char *cmdline)
/* Arch code calls this early on, or if not, just before other parsing. */
void __init parse_early_param(void)
{
- static int done __initdata;
+ static bool done __initdata;
static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata;
if (done)
return;
/* All fall through to do_early_param. */
- strscpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
+ strscpy(tmp_cmdline, boot_command_line);
parse_early_options(tmp_cmdline);
- done = 1;
+ done = true;
}
void __init __weak arch_post_acpi_subsys_init(void) { }