From d000be05e3c7ef47f49a0991402837d67b042d7d Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 3 Jan 2014 14:10:17 +1100 Subject: [PATCH] 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 Cc: Dan Carpenter Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ec69c49b7e54..e5a6a5246fb7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3118,7 +3118,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) { -- 2.39.5