aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/workqueue.h15
-rw-r--r--kernel/workqueue.c7
2 files changed, 11 insertions, 11 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index f4960260feaf..f3c47a05fd06 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -17,7 +17,7 @@ struct workqueue_struct;
17 17
18struct work_struct; 18struct work_struct;
19typedef void (*work_func_t)(struct work_struct *work); 19typedef void (*work_func_t)(struct work_struct *work);
20void delayed_work_timer_fn(unsigned long __data); 20void delayed_work_timer_fn(struct timer_list *t);
21 21
22/* 22/*
23 * The first word is the work queue pointer and the flags rolled into 23 * The first word is the work queue pointer and the flags rolled into
@@ -175,8 +175,8 @@ struct execute_work {
175 175
176#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \ 176#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
177 .work = __WORK_INITIALIZER((n).work, (f)), \ 177 .work = __WORK_INITIALIZER((n).work, (f)), \
178 .timer = __TIMER_INITIALIZER(delayed_work_timer_fn, \ 178 .timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)delayed_work_timer_fn,\
179 (unsigned long)&(n), \ 179 (TIMER_DATA_TYPE)&(n.timer), \
180 (tflags) | TIMER_IRQSAFE), \ 180 (tflags) | TIMER_IRQSAFE), \
181 } 181 }
182 182
@@ -241,8 +241,9 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
241#define __INIT_DELAYED_WORK(_work, _func, _tflags) \ 241#define __INIT_DELAYED_WORK(_work, _func, _tflags) \
242 do { \ 242 do { \
243 INIT_WORK(&(_work)->work, (_func)); \ 243 INIT_WORK(&(_work)->work, (_func)); \
244 __setup_timer(&(_work)->timer, delayed_work_timer_fn, \ 244 __setup_timer(&(_work)->timer, \
245 (unsigned long)(_work), \ 245 (TIMER_FUNC_TYPE)delayed_work_timer_fn, \
246 (TIMER_DATA_TYPE)&(_work)->timer, \
246 (_tflags) | TIMER_IRQSAFE); \ 247 (_tflags) | TIMER_IRQSAFE); \
247 } while (0) 248 } while (0)
248 249
@@ -250,8 +251,8 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
250 do { \ 251 do { \
251 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ 252 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
252 __setup_timer_on_stack(&(_work)->timer, \ 253 __setup_timer_on_stack(&(_work)->timer, \
253 delayed_work_timer_fn, \ 254 (TIMER_FUNC_TYPE)delayed_work_timer_fn,\
254 (unsigned long)(_work), \ 255 (TIMER_DATA_TYPE)&(_work)->timer,\
255 (_tflags) | TIMER_IRQSAFE); \ 256 (_tflags) | TIMER_IRQSAFE); \
256 } while (0) 257 } while (0)
257 258
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index a5361fc6215d..c77fdf6bf24f 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1492,9 +1492,9 @@ bool queue_work_on(int cpu, struct workqueue_struct *wq,
1492} 1492}
1493EXPORT_SYMBOL(queue_work_on); 1493EXPORT_SYMBOL(queue_work_on);
1494 1494
1495void delayed_work_timer_fn(unsigned long __data) 1495void delayed_work_timer_fn(struct timer_list *t)
1496{ 1496{
1497 struct delayed_work *dwork = (struct delayed_work *)__data; 1497 struct delayed_work *dwork = from_timer(dwork, t, timer);
1498 1498
1499 /* should have been called from irqsafe timer with irq already off */ 1499 /* should have been called from irqsafe timer with irq already off */
1500 __queue_work(dwork->cpu, dwork->wq, &dwork->work); 1500 __queue_work(dwork->cpu, dwork->wq, &dwork->work);
@@ -1508,8 +1508,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq,
1508 struct work_struct *work = &dwork->work; 1508 struct work_struct *work = &dwork->work;
1509 1509
1510 WARN_ON_ONCE(!wq); 1510 WARN_ON_ONCE(!wq);
1511 WARN_ON_ONCE(timer->function != delayed_work_timer_fn || 1511 WARN_ON_ONCE(timer->function != (TIMER_FUNC_TYPE)delayed_work_timer_fn);
1512 timer->data != (unsigned long)dwork);
1513 WARN_ON_ONCE(timer_pending(timer)); 1512 WARN_ON_ONCE(timer_pending(timer));
1514 WARN_ON_ONCE(!list_empty(&work->entry)); 1513 WARN_ON_ONCE(!list_empty(&work->entry));
1515 1514