aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/timer.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-10 00:52:09 -0400
committerKees Cook <keescook@chromium.org>2017-11-08 18:54:09 -0500
commit3653bc95bcc7daa938c0fdcd64ff199ed8f7f208 (patch)
tree45aa561055dd779b75b4181d8855b4481dd483be /include/linux/timer.h
parent8ef81c65485b94c59b8ae43ed7d1d75c3562a835 (diff)
timer: Prepare to change all DEFINE_TIMER() callbacks
Before we can globally change the function prototype of all timer callbacks, we have to change those set up by DEFINE_TIMER(). Prepare for this by casting the callbacks until the prototype changes globally. Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r--include/linux/timer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h
index a1af92bac0d5..9f8895decb82 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -63,6 +63,9 @@ struct timer_list {
63 63
64#define TIMER_TRACE_FLAGMASK (TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE) 64#define TIMER_TRACE_FLAGMASK (TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE)
65 65
66#define TIMER_DATA_TYPE unsigned long
67#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE)
68
66#define __TIMER_INITIALIZER(_function, _data, _flags) { \ 69#define __TIMER_INITIALIZER(_function, _data, _flags) { \
67 .entry = { .next = TIMER_ENTRY_STATIC }, \ 70 .entry = { .next = TIMER_ENTRY_STATIC }, \
68 .function = (_function), \ 71 .function = (_function), \
@@ -74,7 +77,7 @@ struct timer_list {
74 77
75#define DEFINE_TIMER(_name, _function) \ 78#define DEFINE_TIMER(_name, _function) \
76 struct timer_list _name = \ 79 struct timer_list _name = \
77 __TIMER_INITIALIZER(_function, 0, 0) 80 __TIMER_INITIALIZER((TIMER_FUNC_TYPE)_function, 0, 0)
78 81
79void init_timer_key(struct timer_list *timer, unsigned int flags, 82void init_timer_key(struct timer_list *timer, unsigned int flags,
80 const char *name, struct lock_class_key *key); 83 const char *name, struct lock_class_key *key);
@@ -147,9 +150,6 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
147#define setup_pinned_deferrable_timer_on_stack(timer, fn, data) \ 150#define setup_pinned_deferrable_timer_on_stack(timer, fn, data) \
148 __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE | TIMER_PINNED) 151 __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE | TIMER_PINNED)
149 152
150#define TIMER_DATA_TYPE unsigned long
151#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE)
152
153#ifndef CONFIG_LOCKDEP 153#ifndef CONFIG_LOCKDEP
154static inline void timer_setup(struct timer_list *timer, 154static inline void timer_setup(struct timer_list *timer,
155 void (*callback)(struct timer_list *), 155 void (*callback)(struct timer_list *),