[PATCH] lockdep: clean up completion initializer in smpboot.c
authorIngo Molnar <mingo@elte.hu>
Mon, 10 Jul 2006 11:44:05 +0000 (04:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:14 +0000 (13:24 -0700)
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>
arch/x86_64/kernel/smpboot.c
include/linux/completion.h

index b7c70596979143f5ec70af8b38a2de656b424dcd..975380207b46c58ea1f109d8ef3b3bfe9de4cf4b 100644 (file)
@@ -771,12 +771,10 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
        unsigned long start_rip;
        struct create_idle c_idle = {
                .cpu = cpu,
-               .done = COMPLETION_INITIALIZER(c_idle.done),
+               .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
        };
        DECLARE_WORK(work, do_fork_idle, &c_idle);
 
-       lockdep_set_class(&c_idle.done.wait.lock, &waitqueue_lock_key);
-
        /* allocate memory for gdts of secondary cpus. Hotplug is considered */
        if (!cpu_gdt_descr[cpu].address &&
                !(cpu_gdt_descr[cpu].address = get_zeroed_page(GFP_KERNEL))) {
index 251c41e3ddd5b870f3c05c1654ded90a02d95cff..268c5a4a2bd4d5611d85da425ed1f66ee5eed883 100644 (file)
@@ -18,6 +18,9 @@ struct completion {
 #define COMPLETION_INITIALIZER(work) \
        { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
 
+#define COMPLETION_INITIALIZER_ONSTACK(work) \
+       ({ init_completion(&work); work; })
+
 #define DECLARE_COMPLETION(work) \
        struct completion work = COMPLETION_INITIALIZER(work)
 
@@ -28,7 +31,7 @@ struct completion {
  */
 #ifdef CONFIG_LOCKDEP
 # define DECLARE_COMPLETION_ONSTACK(work) \
-       struct completion work = ({ init_completion(&work); work; })
+       struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
 #else
 # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
 #endif