summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-07-04 02:05:32 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-04 03:07:45 +0400
commit786b632622800d73d9b0355c9a79b3f3b5792c6c (patch)
treee78b97a8730cbbe1c713a6ae4f1811ad78aab871 /scripts
parent3705ce5bcc1037b68e9d20f90ab50bc7f64edd00 (diff)
downloadlinux-786b632622800d73d9b0355c9a79b3f3b5792c6c.tar.xz
checkpatch: move test for space before semicolon after operator spacing
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9696be57ea42..5989415985ae 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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",