aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2008-10-16 01:02:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:36 -0400
commit6f779c18ca74358b6ac8eb8f5d502843fa92be4e (patch)
treec40e6fe4bd88c7f6c2f892cfcc965f972f0b9cad /scripts/checkpatch.pl
parent5368df20fb364e394da3ab88d3d60ee3c0a9e5ba (diff)
checkpatch: suspect indent count condition lines correctly
Correct calculation of the number of lines of condition where we have suspect indent. 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/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a2e4a3d9c6d..2e513fdf304 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1417,7 +1417,8 @@ sub process {
1417 $s =~ s/\n./\n/gs; 1417 $s =~ s/\n./\n/gs;
1418 1418
1419 # Find out how long the conditional actually is. 1419 # Find out how long the conditional actually is.
1420 my $cond_lines = 0 + $c =~ /\n/gs; 1420 my @newlines = ($c =~ /\n/gs);
1421 my $cond_lines = 1 + $#newlines;
1421 1422
1422 # We want to check the first line inside the block 1423 # We want to check the first line inside the block
1423 # starting at the end of the conditional, so remove: 1424 # starting at the end of the conditional, so remove: