Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2e248e7 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe Perches <joe@perches.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8c5fcd24
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {