public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: checkpatch: kill the bogus camelcase check
Date: Tue, 09 Apr 2013 14:50:54 -0700	[thread overview]
Message-ID: <1365544254.2946.53.camel@dabdike> (raw)

It's making checkpatch unusable on most drivers because it's spewing
tons of bogus warnings.  The problem is the assumption that studly caps
is always wrong: it isn't if the variables are named after the various
conventions in the hardware programming guides (which are usually
written by Microsoft people).

In order to encourage people to use checkpatch, it has to be *useful* it
can't stray too far into dogmatic things like this that are essentially
unfixable by most people who submit patches.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>

---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b28cc38..5588dd3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1398,8 +1398,6 @@ sub process {
 	my %suppress_export;
 	my $suppress_statement = 0;
 
-	my %camelcase = ();
-
 	# Pre-scan the patch sanitizing the lines.
 	# Pre-scan the patch looking for any __setup documentation.
 	#
@@ -2925,19 +2923,6 @@ sub process {
 			}
 		}
 
-#CamelCase
-		while ($line =~ m{($Constant|$Lval)}g) {
-			my $var = $1;
-			if ($var !~ /$Constant/ &&
-			    $var =~ /[A-Z]\w*[a-z]|[a-z]\w*[A-Z]/ &&
-			    $var !~ /"^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ &&
-			    !defined $camelcase{$var}) {
-				$camelcase{$var} = 1;
-				WARN("CAMELCASE",
-				     "Avoid CamelCase: <$var>\n" . $herecurr);
-			}
-		}
-
 #no spaces allowed after \ in define
 		if ($line=~/\#\s*define.*\\\s$/) {
 			WARN("WHITESPACE_AFTER_LINE_CONTINUATION",



             reply	other threads:[~2013-04-09 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 21:50 James Bottomley [this message]
2013-04-10 13:26 ` checkpatch: kill the bogus camelcase check 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
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=1365544254.2946.53.camel@dabdike \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox