summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt2006-07-30 12:03:38 +0200
committerLinus Torvalds2006-07-31 22:28:40 +0200
commit6ea24f9ad18c65cc179593b5cc2a88cdadf8cc0c (patch)
tree7a47cc8e18a6f25b4af0560282d8a0315f72241d
parent[PATCH] cpu hotplug: use hotplug version of registration in late inits (diff)
downloadkernel-qcow2-linux-6ea24f9ad18c65cc179593b5cc2a88cdadf8cc0c.tar.gz
kernel-qcow2-linux-6ea24f9ad18c65cc179593b5cc2a88cdadf8cc0c.tar.xz
kernel-qcow2-linux-6ea24f9ad18c65cc179593b5cc2a88cdadf8cc0c.zip
[PATCH] fix bad macro param in timer.c
We have #define INDEX(N) (base->timer_jiffies >> (TVR_BITS + N * TVN_BITS)) & TVN_MASK and it's used via list = varray[i + 1]->vec + (INDEX(i + 1)); So, due to underparenthesisation, this INDEX(i+1) is now a ... (TVR_BITS + i + 1 * TVN_BITS)) ... So this bugfix changes behaviour. It worked before by sheer luck: "If i was anything but 0, it was broken. But this was only used by s390 and arm. Since it was for the next interrupt, could that next interrupt be a problem (going into the second cascade)? But it was probably seldom wrong. That is, this would fail if the next interrupt was in the second cascade, and was wrapped. Which may never of happened. Also if it did happen, it would have just missed the interrupt. If an interrupt was missed, and no one was there to miss it, was it really missed :-)" Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index ee319fc69f40..726caf9a0a69 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -408,7 +408,7 @@ static int cascade(tvec_base_t *base, tvec_t *tv, int index)
* This function cascades all vectors and executes all expired timer
* vectors.
*/
-#define INDEX(N) (base->timer_jiffies >> (TVR_BITS + N * TVN_BITS)) & TVN_MASK
+#define INDEX(N) ((base->timer_jiffies >> (TVR_BITS + (N) * TVN_BITS)) & TVN_MASK)
static inline void __run_timers(tvec_base_t *base)
{