mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +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
|
@ -1146,12 +1146,8 @@ fastcall signed long __sched schedule_timeout(signed long timeout)
|
|||
|
||||
expire = timeout + jiffies;
|
||||
|
||||
init_timer(&timer);
|
||||
timer.expires = expire;
|
||||
timer.data = (unsigned long) current;
|
||||
timer.function = process_timeout;
|
||||
|
||||
add_timer(&timer);
|
||||
setup_timer(&timer, process_timeout, (unsigned long)current);
|
||||
__mod_timer(&timer, expire);
|
||||
schedule();
|
||||
del_singleshot_timer_sync(&timer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue