From 0350c0498e8eb1b638f74db9595b69594e210257 Mon Sep 17 00:00:00 2001 From: "Hildner, Christian" Date: Mon, 8 Oct 2012 15:49:03 +0200 Subject: [PATCH] --- yaml --- r: 333881 b: refs/heads/master c: 26cff4e2aa4d666dc6a120ea34336b5057e3e187 h: refs/heads/master i: 333879: 883b79e414adab622672b37c5aac359f74194820 v: v3 --- [refs] | 2 +- trunk/kernel/timer.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 1ac7660860d1..7c57bbcc8898 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: db8c246937713e60b7628661ccc187eeb81f2bae +refs/heads/master: 26cff4e2aa4d666dc6a120ea34336b5057e3e187 diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c index d5de1b2292aa..367d00858482 100644 --- a/trunk/kernel/timer.c +++ b/trunk/kernel/timer.c @@ -63,6 +63,7 @@ EXPORT_SYMBOL(jiffies_64); #define TVR_SIZE (1 << TVR_BITS) #define TVN_MASK (TVN_SIZE - 1) #define TVR_MASK (TVR_SIZE - 1) +#define MAX_TVAL ((unsigned long)((1ULL << (TVR_BITS + 4*TVN_BITS)) - 1)) struct tvec { struct list_head vec[TVN_SIZE]; @@ -359,11 +360,12 @@ __internal_add_timer(struct tvec_base *base, struct timer_list *timer) vec = base->tv1.vec + (base->timer_jiffies & TVR_MASK); } else { int i; - /* If the timeout is larger than 0xffffffff on 64-bit - * architectures then we use the maximum timeout: + /* If the timeout is larger than MAX_TVAL (on 64-bit + * architectures or with CONFIG_BASE_SMALL=1) then we + * use the maximum timeout. */ - if (idx > 0xffffffffUL) { - idx = 0xffffffffUL; + if (idx > MAX_TVAL) { + idx = MAX_TVAL; expires = idx + base->timer_jiffies; } i = (expires >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK;