diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-10-31 00:01:38 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-31 02:37:17 +0100 |
commit | a8db2db1e6a8d323d87a67c5391d48fe2b97faf5 (patch) | |
tree | 0aa5fb9f80e4a476e097337104a3e1f94f39a96e /kernel/timer.c | |
parent | [PATCH] little de_thread() cleanup (diff) | |
download | linux-a8db2db1e6a8d323d87a67c5391d48fe2b97faf5.tar.xz linux-a8db2db1e6a8d323d87a67c5391d48fe2b97faf5.zip |
[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 '')
-rw-r--r-- | kernel/timer.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 6a2e5f8dc725..6ed1a826e5ce 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -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); |