lkml.org 
[lkml]   [2010]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:timers/urgent] timers: Fix slack calculation really


On Tue, 25 May 2010, tip-bot for Thomas Gleixner wrote:
> {
> - unsigned long expires_limit, mask;
> + unsigned long expires_limit, mask, now;
> int bit;
>
> 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


\
 
 \ /
  Last update: 2010-05-25 21:19    [W:5.045 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site