diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-04 19:27:07 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-10-05 09:01:22 -0400 |
commit | 8c20feb60604d91a29cd7fef8ac758bd92d9fd2c (patch) | |
tree | 8a15446f1cd0810460cb495c74ead16f0508a4f3 /include/linux/workqueue.h | |
parent | fe5c3b69b540e3387223a696f327c1bb8880d1ac (diff) |
workqueue: Convert callback to use from_timer()
In preparation for unconditionally passing the struct timer_list pointer
to all timer callbacks, switch workqueue to use from_timer() and pass the
timer pointer explicitly.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Cc: Petr Mladek <pmladek@suse.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux1394-devel@lists.sourceforge.net
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-s390@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Ursula Braun <ubraun@linux.vnet.ibm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Harish Patil <harish.patil@cavium.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Manish Chopra <manish.chopra@cavium.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-pm@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Mark Gross <mark.gross@intel.com>
Cc: linux-watchdog@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Michael Reed <mdr@sgi.com>
Cc: netdev@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lkml.kernel.org/r/1507159627-127660-14-git-send-email-keescook@chromium.org
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 15 |
1 files changed, 8 insertions, 7 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 | ||
18 | struct work_struct; | 18 | struct work_struct; |
19 | typedef void (*work_func_t)(struct work_struct *work); | 19 | typedef void (*work_func_t)(struct work_struct *work); |
20 | void delayed_work_timer_fn(unsigned long __data); | 20 | void 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 | ||