diff options
author | Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> | 2008-07-25 22:45:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 15:00:04 -0400 |
commit | 7babe8db99d305340cf4828ce1f5a1481d5622ef (patch) | |
tree | fdac7a084646bb6d125ebc62b0b75806e45d1025 /kernel | |
parent | c2147a5092cfe13dbf3210e54e8a622015edeecc (diff) |
Full conversion to early_initcall() interface, remove old interface
A previous patch added the early_initcall(), to allow a cleaner hooking of
pre-SMP initcalls. Now we remove the older interface, converting all
existing users to the new one.
[akpm@linux-foundation.org: cleanups]
[akpm@linux-foundation.org: build fix]
[kosaki.motohiro@jp.fujitsu.com: warning fix]
[kosaki.motohiro@jp.fujitsu.com: warning fix]
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 5 | ||||
-rw-r--r-- | kernel/smp.c | 4 | ||||
-rw-r--r-- | kernel/softirq.c | 3 | ||||
-rw-r--r-- | kernel/softlockup.c | 25 |
4 files changed, 31 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 0047bd9b96aa..fde1a1026359 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -6389,7 +6389,7 @@ static struct notifier_block __cpuinitdata migration_notifier = { | |||
6389 | .priority = 10 | 6389 | .priority = 10 |
6390 | }; | 6390 | }; |
6391 | 6391 | ||
6392 | void __init migration_init(void) | 6392 | static int __init migration_init(void) |
6393 | { | 6393 | { |
6394 | void *cpu = (void *)(long)smp_processor_id(); | 6394 | void *cpu = (void *)(long)smp_processor_id(); |
6395 | int err; | 6395 | int err; |
@@ -6399,7 +6399,10 @@ void __init migration_init(void) | |||
6399 | BUG_ON(err == NOTIFY_BAD); | 6399 | BUG_ON(err == NOTIFY_BAD); |
6400 | migration_call(&migration_notifier, CPU_ONLINE, cpu); | 6400 | migration_call(&migration_notifier, CPU_ONLINE, cpu); |
6401 | register_cpu_notifier(&migration_notifier); | 6401 | register_cpu_notifier(&migration_notifier); |
6402 | |||
6403 | return err; | ||
6402 | } | 6404 | } |
6405 | early_initcall(migration_init); | ||
6403 | #endif | 6406 | #endif |
6404 | 6407 | ||
6405 | #ifdef CONFIG_SMP | 6408 | #ifdef CONFIG_SMP |
diff --git a/kernel/smp.c b/kernel/smp.c index 462c785ca1ee..96fc7c0edc59 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
@@ -33,7 +33,7 @@ struct call_single_queue { | |||
33 | spinlock_t lock; | 33 | spinlock_t lock; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | void __cpuinit init_call_single_data(void) | 36 | static int __cpuinit init_call_single_data(void) |
37 | { | 37 | { |
38 | int i; | 38 | int i; |
39 | 39 | ||
@@ -43,7 +43,9 @@ void __cpuinit init_call_single_data(void) | |||
43 | spin_lock_init(&q->lock); | 43 | spin_lock_init(&q->lock); |
44 | INIT_LIST_HEAD(&q->list); | 44 | INIT_LIST_HEAD(&q->list); |
45 | } | 45 | } |
46 | return 0; | ||
46 | } | 47 | } |
48 | early_initcall(init_call_single_data); | ||
47 | 49 | ||
48 | static void csd_flag_wait(struct call_single_data *data) | 50 | static void csd_flag_wait(struct call_single_data *data) |
49 | { | 51 | { |
diff --git a/kernel/softirq.c b/kernel/softirq.c index f6b03d56c2bf..c506f266a6b9 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -630,7 +630,7 @@ static struct notifier_block __cpuinitdata cpu_nfb = { | |||
630 | .notifier_call = cpu_callback | 630 | .notifier_call = cpu_callback |
631 | }; | 631 | }; |
632 | 632 | ||
633 | __init int spawn_ksoftirqd(void) | 633 | static __init int spawn_ksoftirqd(void) |
634 | { | 634 | { |
635 | void *cpu = (void *)(long)smp_processor_id(); | 635 | void *cpu = (void *)(long)smp_processor_id(); |
636 | int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); | 636 | int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); |
@@ -640,6 +640,7 @@ __init int spawn_ksoftirqd(void) | |||
640 | register_cpu_notifier(&cpu_nfb); | 640 | register_cpu_notifier(&cpu_nfb); |
641 | return 0; | 641 | return 0; |
642 | } | 642 | } |
643 | early_initcall(spawn_ksoftirqd); | ||
643 | 644 | ||
644 | #ifdef CONFIG_SMP | 645 | #ifdef CONFIG_SMP |
645 | /* | 646 | /* |
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index 7bd8d1aadd5d..b75b492fbfcf 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -338,14 +338,33 @@ static struct notifier_block __cpuinitdata cpu_nfb = { | |||
338 | .notifier_call = cpu_callback | 338 | .notifier_call = cpu_callback |
339 | }; | 339 | }; |
340 | 340 | ||
341 | __init void spawn_softlockup_task(void) | 341 | static int __initdata nosoftlockup; |
342 | |||
343 | static int __init nosoftlockup_setup(char *str) | ||
344 | { | ||
345 | nosoftlockup = 1; | ||
346 | return 1; | ||
347 | } | ||
348 | __setup("nosoftlockup", nosoftlockup_setup); | ||
349 | |||
350 | static int __init spawn_softlockup_task(void) | ||
342 | { | 351 | { |
343 | void *cpu = (void *)(long)smp_processor_id(); | 352 | void *cpu = (void *)(long)smp_processor_id(); |
344 | int err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); | 353 | int err; |
345 | 354 | ||
346 | BUG_ON(err == NOTIFY_BAD); | 355 | if (nosoftlockup) |
356 | return 0; | ||
357 | |||
358 | err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); | ||
359 | if (err == NOTIFY_BAD) { | ||
360 | BUG(); | ||
361 | return 1; | ||
362 | } | ||
347 | cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); | 363 | cpu_callback(&cpu_nfb, CPU_ONLINE, cpu); |
348 | register_cpu_notifier(&cpu_nfb); | 364 | register_cpu_notifier(&cpu_nfb); |
349 | 365 | ||
350 | atomic_notifier_chain_register(&panic_notifier_list, &panic_block); | 366 | atomic_notifier_chain_register(&panic_notifier_list, &panic_block); |
367 | |||
368 | return 0; | ||
351 | } | 369 | } |
370 | early_initcall(spawn_softlockup_task); | ||