X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Ftimer.c;h=349953ee90272043b48fe9331c32318c5b16a153;hb=edeb8f82dff6d09343e0ec195edae6ed19d6423e;hp=f2f71d7c8491e357efd11bd0bb6cff47ca40fbee;hpb=9ea470782e37a58e3fc2e592648248fb8fb6ca31;p=pandora-kernel.git diff --git a/kernel/timer.c b/kernel/timer.c index f2f71d7c8491..349953ee9027 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -145,9 +145,11 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu, /* now that we have rounded, subtract the extra skew again */ j -= cpu * 3; - if (j <= jiffies) /* rounding ate our timeout entirely; */ - return original; - return j; + /* + * Make sure j is still in the future. Otherwise return the + * unmodified value. + */ + return time_is_after_jiffies(j) ? j : original; } /** @@ -767,7 +769,7 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires) bit = find_last_bit(&mask, BITS_PER_LONG); - mask = (1 << bit) - 1; + mask = (1UL << bit) - 1; expires_limit = expires_limit & ~(mask);