diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 464dcef79b35..7d3bc2f3c326 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3912,10 +3912,15 @@ sub process { | |||
3912 | 3912 | ||
3913 | # prefer usleep_range over udelay | 3913 | # prefer usleep_range over udelay |
3914 | if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { | 3914 | if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { |
3915 | my $delay = $1; | ||
3915 | # ignore udelay's < 10, however | 3916 | # ignore udelay's < 10, however |
3916 | if (! ($1 < 10) ) { | 3917 | if (! ($delay < 10) ) { |
3917 | CHK("USLEEP_RANGE", | 3918 | CHK("USLEEP_RANGE", |
3918 | "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $line); | 3919 | "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt\n" . $herecurr); |
3920 | } | ||
3921 | if ($delay > 2000) { | ||
3922 | WARN("LONG_UDELAY", | ||
3923 | "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $herecurr); | ||
3919 | } | 3924 | } |
3920 | } | 3925 | } |
3921 | 3926 | ||
@@ -3923,7 +3928,7 @@ sub process { | |||
3923 | if ($line =~ /\bmsleep\s*\((\d+)\);/) { | 3928 | if ($line =~ /\bmsleep\s*\((\d+)\);/) { |
3924 | if ($1 < 20) { | 3929 | if ($1 < 20) { |
3925 | WARN("MSLEEP", | 3930 | WARN("MSLEEP", |
3926 | "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $line); | 3931 | "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt\n" . $herecurr); |
3927 | } | 3932 | } |
3928 | } | 3933 | } |
3929 | 3934 | ||