Re: [PATCH] init/main.c: check if rdinit was explicitly set before printing warning

From: Andrew Morton

Date: Mon Jan 12 2026 - 15:13:39 EST


On Sun, 11 Jan 2026 07:56:35 -0500 Lillian Berry <lillian@xxxxxxxxxxxx> wrote:

> The rdinit parameter is set by default, and attempted during boot even
> if not specified in the command line. Only print the warning about
> rdinit being inaccessible if the rdinit value was found in command line;
> it's just noise otherwise.
>
> ...
>
> --- a/init/main.c
> +++ b/init/main.c
> @@ -162,6 +162,7 @@ static size_t initargs_offs;
>
> static char *execute_command;
> static char *ramdisk_execute_command = "/init";
> +static bool ramdisk_execute_command_set;

We can use __initdata. yes?

--- a/init/main.c~init-mainc-check-if-rdinit-was-explicitly-set-before-printing-warning-fix
+++ a/init/main.c
@@ -162,7 +162,7 @@ static size_t initargs_offs;

static char *execute_command;
static char *ramdisk_execute_command = "/init";
-static bool ramdisk_execute_command_set;
+static bool __initdata ramdisk_execute_command_set;

/*
* Used to generate warnings if static_key manipulation functions are used
_

I suspect there are other things around here which could be moved into
__initdata.