init: initialize ramdisk_execute_command at compile time
authorChristoph Hellwig <hch@lst.de>
Sun, 7 Jun 2020 07:06:29 +0000 (09:06 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 31 Jul 2020 06:17:51 +0000 (08:17 +0200)
Set ramdisk_execute_command to "/init" at compile time.  The command
line can still override it, but this saves a few instructions and
removes a NULL check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
init/main.c

index db0621d..c2c9143 100644 (file)
@@ -154,7 +154,7 @@ static bool initargs_found;
 #endif
 
 static char *execute_command;
-static char *ramdisk_execute_command;
+static char *ramdisk_execute_command = "/init";
 
 /*
  * Used to generate warnings if static_key manipulation functions are used
@@ -1514,10 +1514,6 @@ static noinline void __init kernel_init_freeable(void)
         * check if there is an early userspace init.  If yes, let it do all
         * the work
         */
-
-       if (!ramdisk_execute_command)
-               ramdisk_execute_command = "/init";
-
        if (ksys_access((const char __user *)
                        ramdisk_execute_command, 0) != 0) {
                ramdisk_execute_command = NULL;