Commit 7e2762e1 authored by Arvind Sankar's avatar Arvind Sankar Committed by Linus Torvalds

init/main.c: remove unnecessary repair_env_string in do_initcall_level

Since commit 08746a65 ("init: fix in-place parameter modification
regression"), parse_args in do_initcall_level is called on a copy of
saved_command_line.  It is unnecessary to call repair_env_string during
this parsing, as this copy is not used for anything later.

Remove the now unnecessary arguments from repair_env_string as well.

Link: http://lkml.kernel.org/r/20191212180023.24339-3-nivedita@alum.mit.eduSigned-off-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
Cc: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b88c50ac
...@@ -246,8 +246,7 @@ static int __init loglevel(char *str) ...@@ -246,8 +246,7 @@ static int __init loglevel(char *str)
early_param("loglevel", loglevel); early_param("loglevel", loglevel);
/* Change NUL term back to "=", to make "param" the whole string. */ /* Change NUL term back to "=", to make "param" the whole string. */
static int __init repair_env_string(char *param, char *val, static void __init repair_env_string(char *param, char *val)
const char *unused, void *arg)
{ {
if (val) { if (val) {
/* param=val or param="val"? */ /* param=val or param="val"? */
...@@ -260,7 +259,6 @@ static int __init repair_env_string(char *param, char *val, ...@@ -260,7 +259,6 @@ static int __init repair_env_string(char *param, char *val,
} else } else
BUG(); BUG();
} }
return 0;
} }
/* Anything after -- gets handed straight to init. */ /* Anything after -- gets handed straight to init. */
...@@ -272,7 +270,7 @@ static int __init set_init_arg(char *param, char *val, ...@@ -272,7 +270,7 @@ static int __init set_init_arg(char *param, char *val,
if (panic_later) if (panic_later)
return 0; return 0;
repair_env_string(param, val, unused, NULL); repair_env_string(param, val);
for (i = 0; argv_init[i]; i++) { for (i = 0; argv_init[i]; i++) {
if (i == MAX_INIT_ARGS) { if (i == MAX_INIT_ARGS) {
...@@ -292,7 +290,7 @@ static int __init set_init_arg(char *param, char *val, ...@@ -292,7 +290,7 @@ static int __init set_init_arg(char *param, char *val,
static int __init unknown_bootoption(char *param, char *val, static int __init unknown_bootoption(char *param, char *val,
const char *unused, void *arg) const char *unused, void *arg)
{ {
repair_env_string(param, val, unused, NULL); repair_env_string(param, val);
/* Handle obsolete-style parameters */ /* Handle obsolete-style parameters */
if (obsolete_checksetup(param)) if (obsolete_checksetup(param))
...@@ -991,6 +989,12 @@ static const char *initcall_level_names[] __initdata = { ...@@ -991,6 +989,12 @@ static const char *initcall_level_names[] __initdata = {
"late", "late",
}; };
static int __init ignore_unknown_bootoption(char *param, char *val,
const char *unused, void *arg)
{
return 0;
}
static void __init do_initcall_level(int level) static void __init do_initcall_level(int level)
{ {
initcall_entry_t *fn; initcall_entry_t *fn;
...@@ -1000,7 +1004,7 @@ static void __init do_initcall_level(int level) ...@@ -1000,7 +1004,7 @@ static void __init do_initcall_level(int level)
initcall_command_line, __start___param, initcall_command_line, __start___param,
__stop___param - __start___param, __stop___param - __start___param,
level, level, level, level,
NULL, &repair_env_string); NULL, ignore_unknown_bootoption);
trace_initcall_level(initcall_level_names[level]); trace_initcall_level(initcall_level_names[level]);
for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment