diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-10-30 18:01:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:17 -0500 |
commit | a8db2db1e6a8d323d87a67c5391d48fe2b97faf5 (patch) | |
tree | 0aa5fb9f80e4a476e097337104a3e1f94f39a96e /include/linux/timer.h | |
parent | 9e4e23bccb127fac109e765dfb7f9372661cb415 (diff) |
[PATCH] introduce setup_timer() helper
Every user of init_timer() also needs to initialize ->function and ->data
fields. This patch adds a simple setup_timer() helper for that.
The schedule_timeout() is patched as an example of usage.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r-- | include/linux/timer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h index 3340f3bd135d..ddd5bbe1fc8e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -38,6 +38,15 @@ extern struct timer_base_s __init_timer_base; | |||
38 | 38 | ||
39 | void fastcall init_timer(struct timer_list * timer); | 39 | void fastcall init_timer(struct timer_list * timer); |
40 | 40 | ||
41 | static inline void setup_timer(struct timer_list * timer, | ||
42 | void (*function)(unsigned long), | ||
43 | unsigned long data) | ||
44 | { | ||
45 | timer->function = function; | ||
46 | timer->data = data; | ||
47 | init_timer(timer); | ||
48 | } | ||
49 | |||
41 | /*** | 50 | /*** |
42 | * timer_pending - is a timer pending? | 51 | * timer_pending - is a timer pending? |
43 | * @timer: the timer in question | 52 | * @timer: the timer in question |