diff options
author | Andy Whitcroft <apw@shadowen.org> | 2008-10-16 01:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:37 -0400 |
commit | 740504c61f79a932564fb7117d79ad53d950b201 (patch) | |
tree | 932ad076982cb1fa4aaffbf8bb73c16667b772ea | |
parent | bb44ad39c886401e1ffe0876565f8b3fcea64e9d (diff) |
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>
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2c1afba57580..862e8e0e86ae 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1465,6 +1465,7 @@ sub process { | |||
1465 | } | 1465 | } |
1466 | 1466 | ||
1467 | my $cond_ptr = -1; | 1467 | my $cond_ptr = -1; |
1468 | $continuation = 0; | ||
1468 | while ($cond_ptr != $cond_lines) { | 1469 | while ($cond_ptr != $cond_lines) { |
1469 | $cond_ptr = $cond_lines; | 1470 | $cond_ptr = $cond_lines; |
1470 | 1471 | ||
@@ -1478,9 +1479,11 @@ sub process { | |||
1478 | # 1) blank lines, they should be at 0, | 1479 | # 1) blank lines, they should be at 0, |
1479 | # 2) preprocessor lines, and | 1480 | # 2) preprocessor lines, and |
1480 | # 3) labels. | 1481 | # 3) labels. |
1481 | if ($s =~ /^\s*?\n/ || | 1482 | if ($continuation || |
1483 | $s =~ /^\s*?\n/ || | ||
1482 | $s =~ /^\s*#\s*?/ || | 1484 | $s =~ /^\s*#\s*?/ || |
1483 | $s =~ /^\s*$Ident\s*:/) { | 1485 | $s =~ /^\s*$Ident\s*:/) { |
1486 | $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; | ||
1484 | $s =~ s/^.*?\n//; | 1487 | $s =~ s/^.*?\n//; |
1485 | $cond_lines++; | 1488 | $cond_lines++; |
1486 | } | 1489 | } |