From: Gerhard Engleder <gerhard@engleder-embedded.com>
To: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Cc: apw@canonical.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com
Subject: Re: [PATCH] checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values
Date: Fri, 30 Dec 2022 22:15:23 +0100 [thread overview]
Message-ID: <abbd5e82-79a8-4917-0dd6-03d8b71cb139@engleder-embedded.com> (raw)
In-Reply-To: <f932082c38d8b67fd15e08c2f4f5eee8e4519291.camel@perches.com>
On 30.12.22 21:31, Joe Perches wrote:
> On Fri, 2022-12-30 at 20:59 +0100, Gerhard Engleder wrote:
>> Since commit 4104a20646 enum values like
>> ETHTOOL_LINK_MODE_Asym_Pause_BIT are ignored. But there are other enums
>> like ETHTOOL_LINK_MODE_1000baseT_Full_BIT, which are not ignored
>> because of the not matching '1000baseT' substring.
>>
>> Extend regex to match also substrings like '1000baseT'.
> []
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
>> @@ -5780,7 +5780,7 @@ sub process {
>> if ($var !~ /^$Constant$/ &&
>> $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
>> #Ignore some autogenerated defines and enum values
>> - $var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ &&
>> + $var !~ /^(?:[A-Z]+_){1,5}([A-Z]{1,3}[a-z]|[0-9]+[a-z]+[A-Z])/ &&
>
> NAK.
>
> This introduces an unnecessary capture group and as well it would also
> allow too many other variants that should get a warning.
A more exact link mode regex [0-9]+base[A-Z0-9]+_(Half|Full) would
eliminate unwanted matches. Shall I extend the existing regex or
would a separate regex with comment be the better choice?
Gerhard
next prev parent reply other threads:[~2022-12-30 21:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-30 19:59 [PATCH] checkpatch: Ignore ETHTOOL_LINK_MODE_ enum values Gerhard Engleder
2022-12-30 20:31 ` Joe Perches
2022-12-30 21:15 ` Gerhard Engleder [this message]
2022-12-30 23:52 ` Joe Perches
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=abbd5e82-79a8-4917-0dd6-03d8b71cb139@engleder-embedded.com \
--to=gerhard@engleder-embedded.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).