summaryrefslogtreecommitdiff
path: root/init/main.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-07 10:06:29 +0300
committerChristoph Hellwig <hch@lst.de>2020-07-31 09:17:51 +0300
commit916db733deca5dc1e14ea8e3acfc121600a9f462 (patch)
tree4fab280d165f0784458ea3e1734de76c1aa3a653 /init/main.c
parentbcbacc4909f1b93242ba2894d0282c151c9d0e68 (diff)
downloadlinux-916db733deca5dc1e14ea8e3acfc121600a9f462.tar.xz
init: initialize ramdisk_execute_command at compile time
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>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/init/main.c b/init/main.c
index db0621dfbb04..c2c9143db967 100644
--- a/init/main.c
+++ b/init/main.c
@@ -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;