aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Borzenkov <pavel.borzenkov@gmail.com>2011-08-26 17:34:37 +0400
committerBlue Swirl <blauwirbel@gmail.com>2011-08-27 15:44:16 +0000
commit01c4330b58909612ac202573da6e1a872b8bb0ad (patch)
tree688c70b2e62ce1b99cb42bcdf65a5f6432625992
parent8733f6093c2b77502e7228503fc22024e51599b8 (diff)
checkpatch: fix braces {} handling
checkpatch.pl doesn't report warning for if/else statements with missing 'else' braces: if (something) { foo; } else bar; The patch has been tested using the last 100 commits. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rwxr-xr-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3498425fff..0eba357cc2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2532,7 +2532,7 @@ sub process {
$allowed = 1;
}
}
- if (!$seen) {
+ if ($seen != ($#chunks + 1)) {
WARN("braces {} are necessary for all arms of this statement\n" . $herectx);
}
}