]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
debugobjects: add and use INIT_WORK_ON_STACK
authorThomas Gleixner <tglx@linutronix.de>
Thu, 22 Jan 2009 08:50:44 +0000 (09:50 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 22 Jan 2009 09:02:07 +0000 (10:02 +0100)
Impact: Fix debugobjects warning

debugobject enabled kernels spit out a warning in hpet code due to a
workqueue which is initialized on stack.

Add INIT_WORK_ON_STACK() which calls init_timer_on_stack() and use it
in hpet.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/hpet.c
include/linux/workqueue.h

index cd759ad90690e72d109aed4309adeb87755977e5..64d5ad0b8add85190ef600bb4f4887889729ef29 100644 (file)
@@ -628,11 +628,12 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
 
        switch (action & 0xf) {
        case CPU_ONLINE:
-               INIT_DELAYED_WORK(&work.work, hpet_work);
+               INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
                init_completion(&work.complete);
                /* FIXME: add schedule_work_on() */
                schedule_delayed_work_on(cpu, &work.work, 0);
                wait_for_completion(&work.complete);
+               destroy_timer_on_stack(&work.work.timer);
                break;
        case CPU_DEAD:
                if (hdev) {
index b36291130f2237e68c678f525e2e0128ec6c6cd1..20b59eb1facd55fb373e04f5ab39147d73327be7 100644 (file)
@@ -124,6 +124,12 @@ struct execute_work {
                init_timer_deferrable(&(_work)->timer);         \
        } while (0)
 
+#define INIT_DELAYED_WORK_ON_STACK(_work, _func)               \
+       do {                                                    \
+               INIT_WORK(&(_work)->work, (_func));             \
+               init_timer_on_stack(&(_work)->timer);           \
+       } while (0)
+
 /**
  * work_pending - Find out whether a work item is currently pending
  * @work: The work item in question