scripts/checkpatch.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
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.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
scripts/checkpatch.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fdf07c897471..628aa9e17e91 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5513,9 +5513,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;
--
2.45.2
On Fri, Jan 10, 2025 at 10:12:17AM +0300, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> scripts/checkpatch.pl | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index fdf07c897471..628aa9e17e91 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5513,9 +5513,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;
> --
> 2.45.2
>
Yes! Thanks for this:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Fri, 2025-01-10 at 08:18 +0100, Greg Kroah-Hartman wrote:
> On Fri, Jan 10, 2025 at 10:12:17AM +0300, Dan Carpenter wrote:
> > 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.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > ---
> > scripts/checkpatch.pl | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index fdf07c897471..628aa9e17e91 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -5513,9 +5513,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;
> > --
> > 2.45.2
> >
>
> Yes! Thanks for this:
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
I have no issue with this.
Andrew, please apply it.
© 2016 - 2025 Red Hat, Inc.