summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-01-21 18:19:40 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-01-21 17:32:45 +0000
commit789f88d0b21fedfd4251d56bb7a9fbfbda7a4ac7 (patch)
treeb298f89336f527590de49548ebb1f579b2fc7fa7 /scripts
parentb947c12c0bb217fe09968e652873e0d22b269d68 (diff)
checkpatch: Fix bracing false positives on #else
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 55ef439865..4fa06c002e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2536,7 +2536,8 @@ sub process {
}
}
if (!defined $suppress_ifbraces{$linenr - 1} &&
- $line =~ /\b(if|while|for|else)\b/) {
+ $line =~ /\b(if|while|for|else)\b/ &&
+ $line !~ /\#\s*else/) {
my $allowed = 0;
# Check the pre-context.