login
Header Space

 
 

[PATCH] update checkpatch.pl to version 0.18

Previous thread: [RFC] x86: Cleanup prose of Documentation/i386/IO-APIC.txt by Nick Andrew on Friday, April 11, 2008 - 11:40 am. (6 messages)

Next thread: [PATCH 00/13] Re: Scalability requirements for sysv ipc by Nadia.Derbey on Friday, April 11, 2008 - 12:17 pm. (17 messages)
To: Andrew Morton <akpm@...>
Cc: Randy Dunlap <rdunlap@...>, Joel Schopp <jschopp@...>, Andy Whitcroft <apw@...>, <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Friday, April 11, 2008 - 11:41 am

[This update is lighter than normal as I want to get these out before
leaving for vacation.]

This version brings a few fixes for the extern checks, and a couple of
new checks.

Of note:
 - false is now recognised as a 0 assignment in static/external
   assignments,
 - printf format strings including %L are reported,
 - a number of fixes for the extern in .c file detector which had
   temporarily lost its ability to detect variables; undetected due to
   the loss of its test.

Andy Whitcroft (8):
      Version: 0.18
      false should trip 0 assignment checks
      tests: reinstate missing tests
      tests: allow specification of the file extension for a test
      fix extern checks for variables
      check for and report %Lu, %Ld, and %Li
      ensure we only start a statement on lines with some content
      extern spacing

Signed-off-by: Andy Whitcroft &lt;apw@shadowen.org&gt;
---
 scripts/checkpatch.pl |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 523ec0f..257fbd5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.17';
+my $V = '0.18';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -1144,7 +1144,7 @@ sub process {
 
 # Check for potential 'bare' types
 		my ($stat, $cond);
-		if ($realcnt) {
+		if ($realcnt &amp;&amp; $line =~ /.\s*\S/) {
 			($stat, $cond) = ctx_statement_block($linenr,
 								$realcnt, 0);
 			$stat =~ s/\n./\n /g;
@@ -1316,12 +1316,12 @@ sub process {
 		}
 
 # check for external initialisers.
-		if ($line =~ /^.$Type\s*$Ident\s*=\s*(0|NULL);/) {
+		if ($line =~ /^.$Type\s*$Ident\s*=\s*(0|NULL|false)\s*;/) {
 			ERROR("do not initialise externals to 0 or NULL\n" .
 				$herecurr);
 		}
 # check for static initialisers.
-		if ($line =~ /\s*static\s.*=\s*(0|NULL);/) {
+		if ($line =~ /\s*static\s.*=\s*(0|NULL|false)\s*;/) {
 			ERROR("...
Previous thread: [RFC] x86: Cleanup prose of Documentation/i386/IO-APIC.txt by Nick Andrew on Friday, April 11, 2008 - 11:40 am. (6 messages)

Next thread: [PATCH 00/13] Re: Scalability requirements for sysv ipc by Nadia.Derbey on Friday, April 11, 2008 - 12:17 pm. (17 messages)
speck-geostationary