summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-01-10 12:41:47 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2014-01-10 12:41:47 +1100
commit71c3c0b0f0649c71fa4ee8dd3333b7351fc76707 (patch)
tree6c116ba1c643d03550f2bd8e10cee8e633d115b9
parente9029e01893223808964afe1b03387006fd8c3bb (diff)
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 <joe@perches.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
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) {