diff options
-rwxr-xr-x | scripts/checkpatch.pl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3e04f80375de..4bad5700670a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3313,6 +3313,22 @@ sub process { | |||
3313 | } | 3313 | } |
3314 | } | 3314 | } |
3315 | 3315 | ||
3316 | # check usleep_range arguments | ||
3317 | if ($^V && $^V ge 5.10.0 && | ||
3318 | defined $stat && | ||
3319 | $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) { | ||
3320 | my $min = $1; | ||
3321 | my $max = $7; | ||
3322 | if ($min eq $max) { | ||
3323 | WARN("USLEEP_RANGE", | ||
3324 | "usleep_range should not use min == max args; see Documentation/timers/timers-howto.txt\n" . "$here\n$stat\n"); | ||
3325 | } elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ && | ||
3326 | $min > $max) { | ||
3327 | WARN("USLEEP_RANGE", | ||
3328 | "usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.txt\n" . "$here\n$stat\n"); | ||
3329 | } | ||
3330 | } | ||
3331 | |||
3316 | # check for new externs in .c files. | 3332 | # check for new externs in .c files. |
3317 | if ($realfile =~ /\.c$/ && defined $stat && | 3333 | if ($realfile =~ /\.c$/ && defined $stat && |
3318 | $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) | 3334 | $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) |