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.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joe Perches 2014-01-23 15:54:41 -08:00 committed by Linus Torvalds
parent 8c5fcd24a9
commit d2e248e7b0
1 changed files with 1 additions and 1 deletions

View File

@ -3121,7 +3121,7 @@ sub process {
}
# check for whitespace before a non-naked semicolon
if ($line =~ /^\+.*\S\s+;/) {
if ($line =~ /^\+.*\S\s+;\s*$/) {
if (WARN("SPACING",
"space prohibited before semicolon\n" . $herecurr) &&
$fix) {