From: Borislav Petkov <bp@alien8.de>
To: Joe Perches <joe@perches.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Andy Whitcroft <apw@canonical.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] checkpatch: Make camelcase test --strict and less noisy
Date: Wed, 1 May 2013 14:34:19 +0200 [thread overview]
Message-ID: <20130501123419.GA29567@pd.tnic> (raw)
In-Reply-To: <1365691503.1929.15.camel@joe-AO722>
On Thu, Apr 11, 2013 at 07:45:03AM -0700, Joe Perches wrote:
> CamelCase tests are a bit noisy against certain
> types of code acceptable to some kernel developers.
>
> Make the test applicable only with --strict.
>
> Do not bleat a message on nominally acceptable
> CamelCase uses that are separated by an _ like
> drm_core_has_MTRR.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> scripts/checkpatch.pl | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 3fb6d86..97226fb 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2937,12 +2937,12 @@ sub process {
> while ($line =~ m{($Constant|$Lval)}g) {
> my $var = $1;
> if ($var !~ /$Constant/ &&
> - $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
> + $var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
> $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
> !defined $camelcase{$var}) {
> $camelcase{$var} = 1;
> - WARN("CAMELCASE",
> - "Avoid CamelCase: <$var>\n" . $herecurr);
> + CHK("CAMELCASE",
> + "Avoid CamelCase: <$var>\n" . $herecurr);
Yep, this is better.
James?
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
next prev parent reply other threads:[~2013-05-01 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 21:50 checkpatch: kill the bogus camelcase check James Bottomley
2013-04-10 13:26 ` Andy Whitcroft
2013-04-10 14:35 ` Joe Perches
2013-04-10 14:52 ` Borislav Petkov
2013-04-10 15:07 ` James Bottomley
2013-04-10 15:19 ` Borislav Petkov
2013-04-11 14:45 ` [PATCH] checkpatch: Make camelcase test --strict and less noisy Joe Perches
2013-05-01 12:34 ` Borislav Petkov [this message]
2013-05-01 13:50 ` James Bottomley
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=20130501123419.GA29567@pd.tnic \
--to=bp@alien8.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.