lkml.org 
[lkml]   [2013]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] timer: Fix jiffies wrap behavior of round_jiffies*()
From
Date
On Wed, 2013-05-29 at 16:38 -0700, Andrew Morton wrote:
> On Wed, 29 May 2013 16:17:47 -0700 Joe Perches <joe@perches.com> wrote:
>
> > > We could perhaps have a checkpatch rule
> > > which looks for comparisons against jiffes (and any other
> > > time-measuring variables we can detect)
> >
> > other variables like?
>
> Grepping for time_after finds a bunch. There's no real pattern to it though.

Yup, that's the problem.
Thought I'd ask what I was missing though.

No variable really stands out as testable other
than jiffies.

I added this to my local queue and I'll send it later.

# check for comparisons of jiffies
if ($line =~ /\bif\s*\((\s*jiffies\s*[\<\>]|.*[\<\>]=?\s*jiffies\b)/) {
WARN("JIFFIES_COMPARISON",
"Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr);
}




\
 
 \ /
  Last update: 2013-05-30 02:01    [W:0.146 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site