[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200714131239.GA162337@ulmo>
Date: Tue, 14 Jul 2020 15:12:39 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: Andy Whitcroft <apw@...onical.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Rob Herring <robh+dt@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch.pl: Allow '+' in compatible strings
On Tue, Jul 14, 2020 at 04:14:36AM -0700, Joe Perches wrote:
> On Tue, 2020-07-14 at 11:41 +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@...dia.com>
> >
> > The current checks will interpret a '+' character as special because
> > they use regular expression matching. Escape the '+' character if it
> > appears in a compatible string.
> >
> > Signed-off-by: Thierry Reding <treding@...dia.com>
>
> Thanks
>
> > ---
> > scripts/checkpatch.pl | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 4c820607540b..8104d0736e7f 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3145,6 +3145,7 @@ sub process {
> > my $vp_file = $dt_path . "vendor-prefixes.yaml";
> >
> > foreach my $compat (@compats) {
> > + $compat =~ s/\+/\\+/;
>
> This changes the @compats array for each line
I'm not overly familiar with the internals of Perl. I was assuming that
$compat would be a copy of each of the strings in @compats. From what
you're saying it sounds like it's more like a pointer to them instead.
Irrespective, does that do any harm, though? I suppose we could add an
extra local variable like we do for compat2 and compat3 and modify that
instead. That way the contents would perhaps remain unmodified.
Is that what you were suggesting?
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists