From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936683Ab3DIVu7 (ORCPT ); Tue, 9 Apr 2013 17:50:59 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:36613 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935623Ab3DIVu5 (ORCPT ); Tue, 9 Apr 2013 17:50:57 -0400 Message-ID: <1365544254.2946.53.camel@dabdike> Subject: checkpatch: kill the bogus camelcase check From: James Bottomley To: Andy Whitcroft , Joe Perches Cc: linux-kernel , linux-scsi Date: Tue, 09 Apr 2013 14:50:54 -0700 Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.6.3 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 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 --- 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",