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 <>
Cc: Dan Carpenter <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 8c5fcd24
......@@ -3121,7 +3121,7 @@ sub process {
# check for whitespace before a non-naked semicolon
if ($line =~ /^\+.*\S\s+;/) {
if ($line =~ /^\+.*\S\s+;\s*$/) {
"space prohibited before semicolon\n" . $herecurr) &&
$fix) {
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