Skip to content

Commit

Permalink
checkpatch: exclude drivers/staging from if with unnecessary parenthe…
Browse files Browse the repository at this point in the history
…ses test

Greg KH doesn't like this test so exclude the staging directory from the
implied --strict only test unless --strict is actually used on the
command-line.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Joe Perches <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Feb 7, 2018
1 parent a134f8d commit a032aa4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4526,7 +4526,9 @@ sub process {
}

# check for unnecessary parentheses around comparisons in if uses
if ($^V && $^V ge 5.10.0 && defined($stat) &&
# when !drivers/staging or command-line uses --strict
if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
$^V && $^V ge 5.10.0 && defined($stat) &&
$stat =~ /(^.\s*if\s*($balanced_parens))/) {
my $if_stat = $1;
my $test = substr($2, 1, -1);
Expand Down

0 comments on commit a032aa4

Please sign in to comment.