aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-10-15 22:02:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 11:21:37 -0700
commit740504c61f79a932564fb7117d79ad53d950b201 (patch)
tree932ad076982cb1fa4aaffbf8bb73c16667b772ea /scripts
parentbb44ad39c886401e1ffe0876565f8b3fcea64e9d (diff)
downloadkernel_goldelico_gta04-740504c61f79a932564fb7117d79ad53d950b201.zip
kernel_goldelico_gta04-740504c61f79a932564fb7117d79ad53d950b201.tar.gz
kernel_goldelico_gta04-740504c61f79a932564fb7117d79ad53d950b201.tar.bz2
checkpatch: suspect indent handle macro continuation
When ignoring a macro in the middle of a conditional, we need to ignore the macro start and any continuation lines. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2c1afba..862e8e0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1465,6 +1465,7 @@ sub process {
}
my $cond_ptr = -1;
+ $continuation = 0;
while ($cond_ptr != $cond_lines) {
$cond_ptr = $cond_lines;
@@ -1478,9 +1479,11 @@ sub process {
# 1) blank lines, they should be at 0,
# 2) preprocessor lines, and
# 3) labels.
- if ($s =~ /^\s*?\n/ ||
+ if ($continuation ||
+ $s =~ /^\s*?\n/ ||
$s =~ /^\s*#\s*?/ ||
$s =~ /^\s*$Ident\s*:/) {
+ $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0;
$s =~ s/^.*?\n//;
$cond_lines++;
}