diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-10-10 11:30:59 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-10-10 11:30:59 +0200 |
| commit | 151aeab77738469ddbf0f9532e2fddd0d231aa2b (patch) | |
| tree | cb1320931d458aeecd1d504575c62ad554a3417a /include/linux/timer.h | |
| parent | 17de4ee04ca925590df036b112c1db8a778e14bf (diff) | |
| parent | 024c9d2faebdad3fb43fe49ad68e91a36190f1e2 (diff) | |
| download | cachepc-linux-151aeab77738469ddbf0f9532e2fddd0d231aa2b.tar.gz cachepc-linux-151aeab77738469ddbf0f9532e2fddd0d231aa2b.zip | |
Merge branch 'sched/urgent' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/timer.h')
| -rw-r--r-- | include/linux/timer.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index e6789b8757d5..6383c528b148 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -168,6 +168,20 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, #define setup_pinned_deferrable_timer_on_stack(timer, fn, data) \ __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE | TIMER_PINNED) +#define TIMER_DATA_TYPE unsigned long +#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) + +static inline void timer_setup(struct timer_list *timer, + void (*callback)(struct timer_list *), + unsigned int flags) +{ + __setup_timer(timer, (TIMER_FUNC_TYPE)callback, + (TIMER_DATA_TYPE)timer, flags); +} + +#define from_timer(var, callback_timer, timer_fieldname) \ + container_of(callback_timer, typeof(*var), timer_fieldname) + /** * timer_pending - is a timer pending? * @timer: the timer in question |
