Re: [PATCH] checkpatch: Make camelcase test --strict and less noisy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <joe@xxxxxxxxxxx>
> > ---
> >  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


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux