checkpatch: exclude drivers/staging from if with unnecessary parentheses test

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/a032aa4c4a54c25f204358248db08a0966d3513c
Commit:     a032aa4c4a54c25f204358248db08a0966d3513c
Parent:     a134f8de9f4014dad35884b3cc211028f0a76c7a
Refname:    refs/heads/master
Author:     Joe Perches <[email protected]>
AuthorDate: Tue Feb 6 15:39:03 2018 -0800
Committer:  Linus Torvalds <[email protected]>
CommitDate: Tue Feb 6 18:32:45 2018 -0800

    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/[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]>
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d2464058ab5d..3a7499de2c2d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.