History

checkpatch: warn only on "space before semicolon" at end of line

The "space before a non-naked semicolon" test has unwanted output when used in "for ( ;; )" loops. Make the test work only on end-of-line statement termination semicolons.

Joe Perches committed 12 years ago

Commit d2e248e1 parent 8c5fcd21 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -3121,7 +3121,7 @@ sub process { · 3120 unmodified lines
31213121 }
31223122
31233123 # check for whitespace before a non-naked semicolon
3124− if ($line =~ /^\+.*\S\s+;/) {
3124+ if ($line =~ /^\+.*\S\s+;\s*$/) {
31253125 if (WARN("SPACING",
31263126 "space prohibited before semicolon\n" . $herecurr) &&
31273127 $fix) {