lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfuBxxzBevMJYSWq5feO20S4h_T-+EZoifOTYJ1NB4B+J1hqQ@mail.gmail.com>
Date:   Mon, 28 Jun 2021 10:53:35 -0600
From:   jim.cromie@...il.com
To:     Joe Perches <joe@...ches.com>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] checkpatch: skip spacing tests on linker scripts

Yes, I agree.

On Sun, Jun 27, 2021 at 9:17 PM Joe Perches <joe@...ches.com> wrote:
>
> On Fri, 2021-06-25 at 21:40 -0600, Jim Cromie wrote:
> > Before issuing a WARNING on spacing, exclude reports on linker
> > scripts, which don't comport to C style rules.  skip_on_filename()
> > skips on *.lds.h files, I think covering all cases.
> []
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -2546,6 +2546,11 @@ sub get_raw_comment {
> >       return $comment;
> >  }
> >
> > +sub skip_on_filename {
> > +     my $fname = shift;
> > +     return $fname =~ m@\.lds\.h$@;
> > +}
>
> nak.  This is poor naming for what is not a generic function.

indeed.



>
> > @@ -5134,7 +5139,8 @@ sub process {
> >                                                       }
> >                                               }
> >                                       } elsif ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
> > -                                             if (ERROR("SPACING",
> > +                                             if (!skip_on_filename($realfile) &&
> > +                                                 ERROR("SPACING",
> >                                                         "need consistent spacing around '$op' $at\n" . $hereptr)) {
> >                                                       $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " ";
> >                                                       if (defined $fix_elements[$n + 2]) {
>
> This .lds.h test is also used in one other place.
>
> It might be better to avoid all tests in .lds.h files by using a
> "next if" much earlier.

YES.  I see the code uses  'next if' syntax. so this would work.

   next if ($filename =~ m@\.lds\.h$@)

I will find a good spot for this line.

thanks
Jim

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ