lkml.org 
[lkml]   [2010]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] Checkpatch: prefer usleep_range over udelay
From
Date
On Tue, 2010-07-27 at 15:39 -0700, Patrick Pannuto wrote:
> When possible, sleeping is (usually) better than delaying,
> however, don't bother callers of udelay < 10us, as those
> cases are not with the switch to usleep_range
> +# prefer usleep_range over udelay
> + if ($line =~ /\budelay\s*\((.+)\);/) {
> + # ignore udelay's < 10, however

This doesn't handle these cases:

udelay(MY_DEFINED_DELAY)
udelay( 100 )

Shouldn't this be:

if (($line =~ /\budelay\s*\(\s*(\w+)\s*\)/ {
WARN("usleep_range is preferred over udelay; see Documentation/timers/delays.txt\n" . $line);
Maybe these should be converted from WARN to CHK



\
 
 \ /
  Last update: 2010-07-28 02:51    [from the cache]
©2003-2011 Jasper Spaans