Commit 786b6326 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: move test for space before semicolon after operator spacing

Moving this test allows the --fix option to work better.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3705ce5b
...@@ -2646,16 +2646,6 @@ sub process { ...@@ -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. # Check operator spacing.
if (!($line=~/\#\s*include/)) { if (!($line=~/\#\s*include/)) {
my $fixed_line = ""; my $fixed_line = "";
...@@ -2920,6 +2910,16 @@ sub process { ...@@ -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 # check for multiple assignments
if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
CHK("MULTIPLE_ASSIGNMENTS", CHK("MULTIPLE_ASSIGNMENTS",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment