[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1359608107.5255.5.camel@joe-AO722>
Date: Wed, 30 Jan 2013 20:55:07 -0800
From: Joe Perches <joe@...ches.com>
To: Bruce Allan <bruce.w.allan@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, Andy Whitcroft <apw@...onical.com>
Subject: Re: [PATCH] checkpatch: fix USLEEP_RANGE test
On Wed, 2013-01-30 at 11:15 -0800, Bruce Allan wrote:
> Do not test udelay() for a value less than 10usec when passed a variable
> instead of a hard-coded number;
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3237,9 +3237,9 @@ sub process {
[]
> # prefer usleep_range over udelay
> - if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) {
> + if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
> # ignore udelay's < 10, however
> - if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) {
> + if (! ($1 < 10) ) {
> CHK("USLEEP_RANGE",
> "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
> }
Thanks Bruce.
Just a trivial comment:
Maybe this would be a little neater as
if ($line =~ \budelay\s*\(\s*(\d+)\s*\) &&
$1 >= 10) {
CHK(etc...)
}
No worries though.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists