[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130130191530.27127.49640.stgit@bwallan-smackover2.jf.intel.com>
Date: Wed, 30 Jan 2013 11:15:30 -0800
From: Bruce Allan <bruce.w.allan@...el.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Whitcroft <apw@...onical.com>
Subject: [PATCH] checkpatch: fix USLEEP_RANGE test
Do not test udelay() for a value less than 10usec when passed a variable
instead of a hard-coded number; there is no way for checkpatch to know the
value of the variable. As it is today, it will complain about variables
with alphanumeric characters plus '_', e.g. foo_bar, but not variables with
other characters, eg. foo->bar.
Signed-off-by: Bruce Allan <bruce.w.allan@...el.com>
Cc: Andy Whitcroft <apw@...onical.com>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4d2c7df..adfb2f6 100755
--- 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);
}
--
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