Commit 336f6c32 authored by Thomas Gleixner's avatar Thomas Gleixner

debugobjects: add and use INIT_WORK_ON_STACK

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: default avatarThomas Gleixner <tglx@linutronix.de>
parent f3b8436a
...@@ -628,11 +628,12 @@ static int hpet_cpuhp_notify(struct notifier_block *n, ...@@ -628,11 +628,12 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
switch (action & 0xf) { switch (action & 0xf) {
case CPU_ONLINE: case CPU_ONLINE:
INIT_DELAYED_WORK(&work.work, hpet_work); INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
init_completion(&work.complete); init_completion(&work.complete);
/* FIXME: add schedule_work_on() */ /* FIXME: add schedule_work_on() */
schedule_delayed_work_on(cpu, &work.work, 0); schedule_delayed_work_on(cpu, &work.work, 0);
wait_for_completion(&work.complete); wait_for_completion(&work.complete);
destroy_timer_on_stack(&work.work.timer);
break; break;
case CPU_DEAD: case CPU_DEAD:
if (hdev) { if (hdev) {
......
...@@ -124,6 +124,12 @@ struct execute_work { ...@@ -124,6 +124,12 @@ struct execute_work {
init_timer_deferrable(&(_work)->timer); \ init_timer_deferrable(&(_work)->timer); \
} while (0) } 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_pending - Find out whether a work item is currently pending
* @work: The work item in question * @work: The work item in question
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment