diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-10 07:44:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:14 -0400 |
commit | f86bf9b7bcc5d325687a8b80da8ee3eb56e02da7 (patch) | |
tree | 393bf9df55fae3932099fa789d110833c7064ef3 | |
parent | d6d897cec29252b8d0785198cfa6ca16d30c739d (diff) |
[PATCH] lockdep: clean up completion initializer in smpboot.c
Clean up lockdep on-stack-completion initializer. (This also removes the
dependency on waitqueue_lock_key.)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/kernel/smpboot.c | 4 | ||||
-rw-r--r-- | include/linux/completion.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index b7c705969791..975380207b46 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -771,12 +771,10 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid) | |||
771 | unsigned long start_rip; | 771 | unsigned long start_rip; |
772 | struct create_idle c_idle = { | 772 | struct create_idle c_idle = { |
773 | .cpu = cpu, | 773 | .cpu = cpu, |
774 | .done = COMPLETION_INITIALIZER(c_idle.done), | 774 | .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done), |
775 | }; | 775 | }; |
776 | DECLARE_WORK(work, do_fork_idle, &c_idle); | 776 | DECLARE_WORK(work, do_fork_idle, &c_idle); |
777 | 777 | ||
778 | lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key); | ||
779 | |||
780 | /* allocate memory for gdts of secondary cpus. Hotplug is considered */ | 778 | /* allocate memory for gdts of secondary cpus. Hotplug is considered */ |
781 | if (!cpu_gdt_descr[cpu].address && | 779 | if (!cpu_gdt_descr[cpu].address && |
782 | !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { | 780 | !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) { |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 251c41e3ddd5..268c5a4a2bd4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -18,6 +18,9 @@ struct completion { | |||
18 | #define COMPLETION_INITIALIZER(work) \ | 18 | #define COMPLETION_INITIALIZER(work) \ |
19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } | 19 | { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } |
20 | 20 | ||
21 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ | ||
22 | ({ init_completion(&work); work; }) | ||
23 | |||
21 | #define DECLARE_COMPLETION(work) \ | 24 | #define DECLARE_COMPLETION(work) \ |
22 | struct completion work = COMPLETION_INITIALIZER(work) | 25 | struct completion work = COMPLETION_INITIALIZER(work) |
23 | 26 | ||
@@ -28,7 +31,7 @@ struct completion { | |||
28 | */ | 31 | */ |
29 | #ifdef CONFIG_LOCKDEP | 32 | #ifdef CONFIG_LOCKDEP |
30 | # define DECLARE_COMPLETION_ONSTACK(work) \ | 33 | # define DECLARE_COMPLETION_ONSTACK(work) \ |
31 | struct completion work = ({ init_completion(&work); work; }) | 34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) |
32 | #else | 35 | #else |
33 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | 36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) |
34 | #endif | 37 | #endif |