projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8bbea96
)
checkpatch: prefer usleep_range over udelay
author
Patrick Pannuto
<
[email protected]
>
Tue, 10 Aug 2010 00:21:01 +0000
(17:21 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 10 Aug 2010 03:45:09 +0000
(20:45 -0700)
When possible, sleeping is (usually) better than delaying; however, don't
bother callers of udelay < 10us, as those cases are generally not worth
the switch to usleep
[
[email protected]
: fix mismatched parentheses]
Signed-off-by: Patrick Pannuto <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc: Ingo Molnar <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
scripts/checkpatch.pl
patch
|
blob
|
history
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index 2018f4349b477ba3eac5d370c1efd5d99c39a1df..8b69af8a76f90acfe2cc2bdf556950c468b97ef3 100755
(executable)
--- a/
scripts/checkpatch.pl
+++ b/
scripts/checkpatch.pl
@@
-2584,6
+2584,14
@@
sub process {
}
}
+# prefer usleep_range over udelay
+ if ($line =~ /\budelay\s*\(\s*(\w+)\s*\)/) {
+ # ignore udelay's < 10, however
+ if (! (($1 =~ /(\d+)/) && ($1 < 10)) ) {
+ CHK("usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line);
+ }
+ }
+
# warn about #ifdefs in C files
# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
# print "#ifdef in C files should be avoided\n";