mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
9e4e23bccb
commit
a8db2db1e6
3 changed files with 15 additions and 10 deletions
|
@ -38,6 +38,15 @@ extern struct timer_base_s __init_timer_base;
|
|||
|
||||
void fastcall init_timer(struct timer_list * timer);
|
||||
|
||||
static inline void setup_timer(struct timer_list * timer,
|
||||
void (*function)(unsigned long),
|
||||
unsigned long data)
|
||||
{
|
||||
timer->function = function;
|
||||
timer->data = data;
|
||||
init_timer(timer);
|
||||
}
|
||||
|
||||
/***
|
||||
* timer_pending - is a timer pending?
|
||||
* @timer: the timer in question
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue