checkpatch: don't warn about extra parentheses in staging/
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 10 Jan 2025 07:12:17 +0000 (10:12 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 25 Jan 2025 06:47:24 +0000 (22:47 -0800)
This "Unnecessary parentheses" warning is disabled for drivers/staging
unless the --strict option is used.  Really, we don't want it at all even
if the --strict option is used.

Link: https://lkml.kernel.org/r/c7278d21-d96c-4c1e-b3bf-f82b8decc5df@stanley.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index c625da28cdae1c30b500001fca096bd9817ab593..9d469c20871f6bb6223aa7513d1c1002bbfe24aa 100755 (executable)
@@ -5503,9 +5503,9 @@ sub process {
                        }
                }
 
-# check for unnecessary parentheses around comparisons in if uses
-# when !drivers/staging or command-line uses --strict
-               if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
+# check for unnecessary parentheses around comparisons
+# except in drivers/staging
+               if (($realfile !~ m@^(?:drivers/staging/)@) &&
                    $perl_version_ok && defined($stat) &&
                    $stat =~ /(^.\s*if\s*($balanced_parens))/) {
                        my $if_stat = $1;