diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8b69af8a76f9..dd11bbe01338 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2592,6 +2592,13 @@ sub process { } } +# warn about unexpectedly long msleep's + if ($line =~ /\bmsleep\s*\((\d+)\);/) { + if ($1 < 20) { + WARN("msleep < 20ms can sleep for up to 20ms; 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";