Re: [PATCH 2/4] Checkpatch: prefer usleep_range over udelay

From: Joe Perches
Date: Tue Jul 27 2010 - 20:48:48 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/