Skip to content

Commit a032aa4

Browse files
JoePerchestorvalds
authored andcommitted
checkpatch: exclude drivers/staging from if with unnecessary parentheses 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/1515704034.9619.165.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a134f8d commit a032aa4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/checkpatch.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4526,7 +4526,9 @@ sub process {
45264526
}
45274527

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

0 commit comments

Comments
 (0)