Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319938
b: refs/heads/master
c: 4a27319
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Jul 31, 2012
1 parent dafd35e commit f34ff83
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce0338df3c9a43e709b8a478265b32b9edcc7ccc
refs/heads/master: 4a273195a551a27a9a3ebed072c8df16c853da7f
16 changes: 16 additions & 0 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3313,6 +3313,22 @@ sub process {
}
}

# check usleep_range arguments
if ($^V && $^V ge 5.10.0 &&
defined $stat &&
$stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) {
my $min = $1;
my $max = $7;
if ($min eq $max) {
WARN("USLEEP_RANGE",
"usleep_range should not use min == max args; see Documentation/timers/timers-howto.txt\n" . "$here\n$stat\n");
} elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ &&
$min > $max) {
WARN("USLEEP_RANGE",
"usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.txt\n" . "$here\n$stat\n");
}
}

# check for new externs in .c files.
if ($realfile =~ /\.c$/ && defined $stat &&
$stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
Expand Down

0 comments on commit f34ff83

Please sign in to comment.