aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-01-23 18:54:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:57 -0500
commitd2e248e7b0068b940f3ca1fc26da603536a533db (patch)
treef40f33a4dfbb04615575be0b1600db48b5894a79 /scripts/checkpatch.pl
parent8c5fcd24a9ea608286816a1508c067c8a512af78 (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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 59fa00e97878..8efce590d4b6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3121,7 +3121,7 @@ sub process {
3121 } 3121 }
3122 3122
3123# check for whitespace before a non-naked semicolon 3123# check for whitespace before a non-naked semicolon
3124 if ($line =~ /^\+.*\S\s+;/) { 3124 if ($line =~ /^\+.*\S\s+;\s*$/) {
3125 if (WARN("SPACING", 3125 if (WARN("SPACING",
3126 "space prohibited before semicolon\n" . $herecurr) && 3126 "space prohibited before semicolon\n" . $herecurr) &&
3127 $fix) { 3127 $fix) {