summaryrefslogtreecommitdiffstats
path: root/kernel/timer.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-03-31 02:30:31 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-31 12:18:53 -0800
commita2c348fe0117adced11e374329a5ea3f7c43cb41 (patch)
tree95233412196f8093e2e82437afeeadd2e479040c /kernel/timer.c
parent3691c5199e8a4be1c7a91b5ab925db5feb866e19 (diff)
downloadlinux-a2c348fe0117adced11e374329a5ea3f7c43cb41.tar.bz2
[PATCH] __mod_timer: simplify ->base changing
Since base and new_base are of the same type now, we can save one 'if' branch and simplify the code a bit. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index b04dc03b5934..9062a82ee8ec 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -215,21 +215,19 @@ int __mod_timer(struct timer_list *timer, unsigned long expires)
* handler yet has not finished. This also guarantees that
* the timer is serialized wrt itself.
*/
- if (unlikely(base->running_timer == timer)) {
- /* The timer remains on a former base */
- new_base = base;
- } else {
+ if (likely(base->running_timer != timer)) {
/* See the comment in lock_timer_base() */
timer->base = NULL;
spin_unlock(&base->lock);
- spin_lock(&new_base->lock);
- timer->base = new_base;
+ base = new_base;
+ spin_lock(&base->lock);
+ timer->base = base;
}
}
timer->expires = expires;
- internal_add_timer(new_base, timer);
- spin_unlock_irqrestore(&new_base->lock, flags);
+ internal_add_timer(base, timer);
+ spin_unlock_irqrestore(&base->lock, flags);
return ret;
}