]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
checkpatch: add check for whitespace before semicolon at end-of-line
authorEric Nelson <eric.nelson@boundarydevices.com>
Thu, 3 May 2012 03:32:18 +0000 (20:32 -0700)
committerWolfgang Denk <wd@denx.de>
Thu, 21 Jun 2012 19:30:02 +0000 (21:30 +0200)
This tests for a bad habits of mine like this:

return 0 ;

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
tools/checkpatch.pl

index 2048a449b51c7b24c4e9cea031b1eab21f817c81..c7475f9e3361d2a01e08b69c1588ee69ddb69bc8 100755 (executable)
@@ -3139,6 +3139,12 @@ sub process {
                         "Statements terminations use 1 semicolon\n" . $herecurr);
                }
 
+# check for whitespace before semicolon - not allowed at end-of-line
+               if ($line =~ /\s+;$/) {
+                   WARN("SPACEBEFORE_SEMICOLON",
+                        "Whitespace before semicolon\n" . $herecurr);
+               }
+
 # check for gcc specific __FUNCTION__
                if ($line =~ /__FUNCTION__/) {
                        WARN("USE_FUNC",