]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/timer.c
tg3: Report driver version to firmware
[net-next-2.6.git] / kernel / timer.c
index e3b8c697bde44b75b76fb23c059a4b4a3942411d..2454172a80d3c6131313007d08f91f12eb85c107 100644 (file)
@@ -752,11 +752,15 @@ unsigned long apply_slack(struct timer_list *timer, unsigned long expires)
 
        expires_limit = expires;
 
-       if (timer->slack > -1)
+       if (timer->slack >= 0) {
                expires_limit = expires + timer->slack;
-       else if (time_after(expires, jiffies)) /* auto slack: use 0.4% */
-               expires_limit = expires + (expires - jiffies)/256;
+       } else {
+               unsigned long now = jiffies;
 
+               /* No slack, if already expired else auto slack 0.4% */
+               if (time_after(expires, now))
+                       expires_limit = expires + (expires - now)/256;
+       }
        mask = expires ^ expires_limit;
        if (mask == 0)
                return expires;