aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2013-02-21 19:44:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:22:26 -0500
commit37581c28e9e77f44a3124ebab99b98643bda1aa2 (patch)
tree3430f2a52b74f201cb20789cf9387d2cd3295a8c /scripts
parent5ce59ae0bcc0f0ad249d21560c9bb5f6061e62a8 (diff)
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@intel.com> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7b40a3f729a7..747bcd768da0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3253,9 +3253,9 @@ sub process {
3253 } 3253 }
3254 3254
3255# prefer usleep_range over udelay 3255# prefer usleep_range over udelay
3256 if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) { 3256 if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) {
3257 # ignore udelay's < 10, however 3257 # ignore udelay's < 10, however
3258 if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) { 3258 if (! ($1 < 10) ) {
3259 CHK("USLEEP_RANGE", 3259 CHK("USLEEP_RANGE",
3260 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); 3260 "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
3261 } 3261 }