From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756810Ab3EANus (ORCPT ); Wed, 1 May 2013 09:50:48 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:48166 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754200Ab3EANul (ORCPT ); Wed, 1 May 2013 09:50:41 -0400 Message-ID: <1367416238.4791.7.camel@dabdike.int.hansenpartnership.com> Subject: Re: [PATCH] checkpatch: Make camelcase test --strict and less noisy From: James Bottomley To: Borislav Petkov Cc: Joe Perches , Andy Whitcroft , linux-kernel , linux-scsi Date: Wed, 01 May 2013 06:50:38 -0700 In-Reply-To: <20130501123419.GA29567@pd.tnic> References: <1365544254.2946.53.camel@dabdike> <20130410132628.GV7511@dm> <1365604558.27174.36.camel@joe-AO722> <20130410145213.GA6854@pd.tnic> <1365606461.1942.3.camel@dabdike> <20130410151911.GG6857@pd.tnic> <1365691503.1929.15.camel@joe-AO722> <20130501123419.GA29567@pd.tnic> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.8.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2013-05-01 at 14:34 +0200, Borislav Petkov wrote: > 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 > > --- > > 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. Fine with me ... I don't use --strict so it will make the message deluge go away. Thanks, James