From 2ce3ec63461f4c483c8378904ae7f63331311a4f Mon Sep 17 00:00:00 2001 From: Patrick Pannuto Date: Mon, 9 Aug 2010 17:21:01 -0700 Subject: [PATCH] --- yaml --- r: 207339 b: refs/heads/master c: 1a15a250862fda3fbdf8454cc7131e24de904e7c h: refs/heads/master i: 207337: 3305ab4670e0b66113547451a11b248579bf6314 207335: baab3cedc63954c4d63767c9c2c15dd509b4b7b7 v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index acc14f5afd53..2384bd7b6917 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8bbea968f9022c3f66a36902509574597611be99 +refs/heads/master: 1a15a250862fda3fbdf8454cc7131e24de904e7c diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 2018f4349b47..8b69af8a76f9 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/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";