]> git.hungrycats.org Git - linux/commitdiff
[PATCH] add unlikely() into add_timer()
authorAndrey Panin <pazke@orbita1.ru>
Thu, 20 Jun 2002 06:41:00 +0000 (23:41 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 20 Jun 2002 06:41:00 +0000 (23:41 -0700)
This micropatch adds unlikely() macro into add_timer() bug check code.
Without this path gcc 3.1 makes bad thing reordering printk() into
the middle of function body.

kernel/timer.c

index 858954c871e1d963422a685497e42d09408c23f0..8c1224697eb0efc4f140ce52f4fd6c63df576624 100644 (file)
@@ -187,7 +187,7 @@ void add_timer(struct timer_list *timer)
        unsigned long flags;
 
        spin_lock_irqsave(&timerlist_lock, flags);
-       if (timer_pending(timer))
+       if (unlikely(timer_pending(timer)))
                goto bug;
        internal_add_timer(timer);
        spin_unlock_irqrestore(&timerlist_lock, flags);