diff options
-rw-r--r-- | arch/x86/kernel/hpet.c | 3 | ||||
-rw-r--r-- | include/linux/workqueue.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index cd759ad90690..64d5ad0b8add 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -628,11 +628,12 @@ static int hpet_cpuhp_notify(struct notifier_block *n, | |||
628 | 628 | ||
629 | switch (action & 0xf) { | 629 | switch (action & 0xf) { |
630 | case CPU_ONLINE: | 630 | case CPU_ONLINE: |
631 | INIT_DELAYED_WORK(&work.work, hpet_work); | 631 | INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work); |
632 | init_completion(&work.complete); | 632 | init_completion(&work.complete); |
633 | /* FIXME: add schedule_work_on() */ | 633 | /* FIXME: add schedule_work_on() */ |
634 | schedule_delayed_work_on(cpu, &work.work, 0); | 634 | schedule_delayed_work_on(cpu, &work.work, 0); |
635 | wait_for_completion(&work.complete); | 635 | wait_for_completion(&work.complete); |
636 | destroy_timer_on_stack(&work.work.timer); | ||
636 | break; | 637 | break; |
637 | case CPU_DEAD: | 638 | case CPU_DEAD: |
638 | if (hdev) { | 639 | if (hdev) { |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index b36291130f22..20b59eb1facd 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -124,6 +124,12 @@ struct execute_work { | |||
124 | init_timer_deferrable(&(_work)->timer); \ | 124 | init_timer_deferrable(&(_work)->timer); \ |
125 | } while (0) | 125 | } while (0) |
126 | 126 | ||
127 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | ||
128 | do { \ | ||
129 | INIT_WORK(&(_work)->work, (_func)); \ | ||
130 | init_timer_on_stack(&(_work)->timer); \ | ||
131 | } while (0) | ||
132 | |||
127 | /** | 133 | /** |
128 | * work_pending - Find out whether a work item is currently pending | 134 | * work_pending - Find out whether a work item is currently pending |
129 | * @work: The work item in question | 135 | * @work: The work item in question |