From: Joe Perches Date: Fri, 3 Jan 2014 03:10:17 +0000 (+1100) Subject: checkpatch: warn only on "space before semicolon" at end of line X-Git-Tag: next-20140106~2^2~90 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d000be05e3c7ef47f49a0991402837d67b042d7d;p=karo-tx-linux.git 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 --- 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) {