]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
checkpatch: move test for space before semicolon after operator spacing
authorJoe Perches <joe@perches.com>
Wed, 19 Jun 2013 00:07:22 +0000 (10:07 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:07 +0000 (17:27 +1000)
Moving this test allows the --fix option to work better.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index 9696be57ea426db6ff1210f1be98cb374cbe15a9..5989415985ae4b93773b662a2847170f12e1f87d 100755 (executable)
@@ -2646,16 +2646,6 @@ sub process {
                        }
                }
 
-# check for whitespace before a non-naked semicolon
-               if ($line =~ /^\+.*\S\s+;/) {
-                       if (WARN("SPACING",
-                                "space prohibited before semicolon\n" . $herecurr) &&
-                           $fix) {
-                               $fixed[$linenr - 1] =~
-                                   s/^(\+.*\S)\s+;/$1;/;
-                       }
-               }
-
 # Check operator spacing.
                if (!($line=~/\#\s*include/)) {
                        my $fixed_line = "";
@@ -2920,6 +2910,16 @@ sub process {
 
                }
 
+# check for whitespace before a non-naked semicolon
+               if ($line =~ /^\+.*\S\s+;/) {
+                       if (WARN("SPACING",
+                                "space prohibited before semicolon\n" . $herecurr) &&
+                           $fix) {
+                               1 while $fixed[$linenr - 1] =~
+                                   s/^(\+.*\S)\s+;/$1;/;
+                       }
+               }
+
 # check for multiple assignments
                if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
                        CHK("MULTIPLE_ASSIGNMENTS",