History

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.

Bruce Allan committed 13 years ago

Commit 37581c21 parent 5ce59ae1 file · +2 −2Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+2−2
@@ -3253,9 +3253,9 @@ sub process { · 3252 unmodified lines
3253 }3253 }
3254 3254
3255# prefer usleep_range over udelay3255# 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, however3257 # 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 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t