Skip to content

Commit 7e2762e

Browse files
nivedita76torvalds
authored andcommitted
init/main.c: remove unnecessary repair_env_string in do_initcall_level
Since commit 08746a6 ("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/[email protected] Signed-off-by: Arvind Sankar <[email protected]> Cc: Krzysztof Mazur <[email protected]> Cc: Chris Metcalf <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b88c50a commit 7e2762e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

init/main.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ static int __init loglevel(char *str)
246246
early_param("loglevel", loglevel);
247247

248248
/* Change NUL term back to "=", to make "param" the whole string. */
249-
static int __init repair_env_string(char *param, char *val,
250-
const char *unused, void *arg)
249+
static void __init repair_env_string(char *param, char *val)
251250
{
252251
if (val) {
253252
/* param=val or param="val"? */
@@ -260,7 +259,6 @@ static int __init repair_env_string(char *param, char *val,
260259
} else
261260
BUG();
262261
}
263-
return 0;
264262
}
265263

266264
/* Anything after -- gets handed straight to init. */
@@ -272,7 +270,7 @@ static int __init set_init_arg(char *param, char *val,
272270
if (panic_later)
273271
return 0;
274272

275-
repair_env_string(param, val, unused, NULL);
273+
repair_env_string(param, val);
276274

277275
for (i = 0; argv_init[i]; i++) {
278276
if (i == MAX_INIT_ARGS) {
@@ -292,7 +290,7 @@ static int __init set_init_arg(char *param, char *val,
292290
static int __init unknown_bootoption(char *param, char *val,
293291
const char *unused, void *arg)
294292
{
295-
repair_env_string(param, val, unused, NULL);
293+
repair_env_string(param, val);
296294

297295
/* Handle obsolete-style parameters */
298296
if (obsolete_checksetup(param))
@@ -991,6 +989,12 @@ static const char *initcall_level_names[] __initdata = {
991989
"late",
992990
};
993991

992+
static int __init ignore_unknown_bootoption(char *param, char *val,
993+
const char *unused, void *arg)
994+
{
995+
return 0;
996+
}
997+
994998
static void __init do_initcall_level(int level)
995999
{
9961000
initcall_entry_t *fn;
@@ -1000,7 +1004,7 @@ static void __init do_initcall_level(int level)
10001004
initcall_command_line, __start___param,
10011005
__stop___param - __start___param,
10021006
level, level,
1003-
NULL, &repair_env_string);
1007+
NULL, ignore_unknown_bootoption);
10041008

10051009
trace_initcall_level(initcall_level_names[level]);
10061010
for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)

0 commit comments

Comments
 (0)