diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-08-08 17:23:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 18:57:27 -0400 |
commit | dd4d9fecbeba893e9ce2488e4d619e5397a2712a (patch) | |
tree | 95f67380f8030288f924f632fea1e3c30e7254d5 /init/main.c | |
parent | 934fc295b30ea8ce5d5e0ab9024a10fab9b6f200 (diff) |
init/main.c: code clean-up
Fixing some checkpatch warnings(remove global initialization, move
__initdata, coalesce formats ...)
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/init/main.c b/init/main.c index e8ae1fef0908..bb1aed928f21 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * GK 2/5/95 - Changed to support mounting root fs via NFS | 6 | * GK 2/5/95 - Changed to support mounting root fs via NFS |
7 | * Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96 | 7 | * Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96 |
8 | * Moan early if gcc is old, avoiding bogus kernels - Paul Gortmaker, May '96 | 8 | * Moan early if gcc is old, avoiding bogus kernels - Paul Gortmaker, May '96 |
9 | * Simplified starting of init: Michael A. Griffith <grif@acm.org> | 9 | * Simplified starting of init: Michael A. Griffith <grif@acm.org> |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define DEBUG /* Enable initcall_debug */ | 12 | #define DEBUG /* Enable initcall_debug */ |
@@ -136,7 +136,7 @@ static char *ramdisk_execute_command; | |||
136 | * Used to generate warnings if static_key manipulation functions are used | 136 | * Used to generate warnings if static_key manipulation functions are used |
137 | * before jump_label_init is called. | 137 | * before jump_label_init is called. |
138 | */ | 138 | */ |
139 | bool static_key_initialized __read_mostly = false; | 139 | bool static_key_initialized __read_mostly; |
140 | EXPORT_SYMBOL_GPL(static_key_initialized); | 140 | EXPORT_SYMBOL_GPL(static_key_initialized); |
141 | 141 | ||
142 | /* | 142 | /* |
@@ -159,8 +159,8 @@ static int __init set_reset_devices(char *str) | |||
159 | 159 | ||
160 | __setup("reset_devices", set_reset_devices); | 160 | __setup("reset_devices", set_reset_devices); |
161 | 161 | ||
162 | static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; | 162 | static const char *argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; |
163 | const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; | 163 | const char *envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; |
164 | static const char *panic_later, *panic_param; | 164 | static const char *panic_later, *panic_param; |
165 | 165 | ||
166 | extern const struct obs_kernel_param __setup_start[], __setup_end[]; | 166 | extern const struct obs_kernel_param __setup_start[], __setup_end[]; |
@@ -199,7 +199,6 @@ static int __init obsolete_checksetup(char *line) | |||
199 | * still work even if initially too large, it will just take slightly longer | 199 | * still work even if initially too large, it will just take slightly longer |
200 | */ | 200 | */ |
201 | unsigned long loops_per_jiffy = (1<<12); | 201 | unsigned long loops_per_jiffy = (1<<12); |
202 | |||
203 | EXPORT_SYMBOL(loops_per_jiffy); | 202 | EXPORT_SYMBOL(loops_per_jiffy); |
204 | 203 | ||
205 | static int __init debug_kernel(char *str) | 204 | static int __init debug_kernel(char *str) |
@@ -376,8 +375,8 @@ static void __init setup_command_line(char *command_line) | |||
376 | initcall_command_line = | 375 | initcall_command_line = |
377 | memblock_virt_alloc(strlen(boot_command_line) + 1, 0); | 376 | memblock_virt_alloc(strlen(boot_command_line) + 1, 0); |
378 | static_command_line = memblock_virt_alloc(strlen(command_line) + 1, 0); | 377 | static_command_line = memblock_virt_alloc(strlen(command_line) + 1, 0); |
379 | strcpy (saved_command_line, boot_command_line); | 378 | strcpy(saved_command_line, boot_command_line); |
380 | strcpy (static_command_line, command_line); | 379 | strcpy(static_command_line, command_line); |
381 | } | 380 | } |
382 | 381 | ||
383 | /* | 382 | /* |
@@ -445,8 +444,8 @@ void __init parse_early_options(char *cmdline) | |||
445 | /* Arch code calls this early on, or if not, just before other parsing. */ | 444 | /* Arch code calls this early on, or if not, just before other parsing. */ |
446 | void __init parse_early_param(void) | 445 | void __init parse_early_param(void) |
447 | { | 446 | { |
448 | static __initdata int done = 0; | 447 | static int done __initdata; |
449 | static __initdata char tmp_cmdline[COMMAND_LINE_SIZE]; | 448 | static char tmp_cmdline[COMMAND_LINE_SIZE] __initdata; |
450 | 449 | ||
451 | if (done) | 450 | if (done) |
452 | return; | 451 | return; |
@@ -500,7 +499,8 @@ static void __init mm_init(void) | |||
500 | 499 | ||
501 | asmlinkage __visible void __init start_kernel(void) | 500 | asmlinkage __visible void __init start_kernel(void) |
502 | { | 501 | { |
503 | char * command_line, *after_dashes; | 502 | char *command_line; |
503 | char *after_dashes; | ||
504 | extern const struct kernel_param __start___param[], __stop___param[]; | 504 | extern const struct kernel_param __start___param[], __stop___param[]; |
505 | 505 | ||
506 | /* | 506 | /* |
@@ -572,7 +572,8 @@ asmlinkage __visible void __init start_kernel(void) | |||
572 | * fragile until we cpu_idle() for the first time. | 572 | * fragile until we cpu_idle() for the first time. |
573 | */ | 573 | */ |
574 | preempt_disable(); | 574 | preempt_disable(); |
575 | if (WARN(!irqs_disabled(), "Interrupts were enabled *very* early, fixing it\n")) | 575 | if (WARN(!irqs_disabled(), |
576 | "Interrupts were enabled *very* early, fixing it\n")) | ||
576 | local_irq_disable(); | 577 | local_irq_disable(); |
577 | idr_init_cache(); | 578 | idr_init_cache(); |
578 | rcu_init(); | 579 | rcu_init(); |