Skip to contentSkip to conversation

timers: Fix slack calculation really

tip:timers/urgent Linus Torvalds 1 participant 1 message May 25, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · tip-bot for Thomas Gleixner

{

(quoted diff) +1 -1
-	unsigned long expires_limit, mask;
+	unsigned long expires_limit, mask, now;
 	int bit;
 

Review

Quoted 10 lines
(quoted diff) +3 -4
 	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 {
+		now = jiffies;

So this works, but I'd really suggest that you actually nest the declarations correctly too.

Linus