From: Joe Perches Date: Thu, 23 Jan 2014 23:54:41 +0000 (-0800) Subject: checkpatch: warn only on "space before semicolon" at end of line X-Git-Tag: upstream/snapshot3+hdmi~3586^2~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2e248e7b0068b940f3ca1fc26da603536a533db;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.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 Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 59fa00e..8efce59 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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) {