public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch.pl: Allow '+' in compatible strings
Date: Tue, 14 Jul 2020 15:12:39 +0200	[thread overview]
Message-ID: <20200714131239.GA162337@ulmo> (raw)
In-Reply-To: <cd892c33922c477622ede83d80592e71098c4dc2.camel@perches.com>

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

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@nvidia.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@nvidia.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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-07-14 13:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  9:41 [PATCH] checkpatch.pl: Allow '+' in compatible strings Thierry Reding
2020-07-14 11:14 ` Joe Perches
2020-07-14 13:12   ` Thierry Reding [this message]
2020-07-14 16:21 ` Rob Herring
2020-07-14 17:12   ` Joe Perches
2020-07-14 17:42     ` Rob Herring
2020-07-15  7:22       ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200714131239.GA162337@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox