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>
This commit is contained in:
parent
5368df20fb
commit
6f779c18ca
1 changed files with 2 additions and 1 deletions
|
@ -1417,7 +1417,8 @@ sub process {
|
||||||
$s =~ s/\n./\n/gs;
|
$s =~ s/\n./\n/gs;
|
||||||
|
|
||||||
# Find out how long the conditional actually is.
|
# Find out how long the conditional actually is.
|
||||||
my $cond_lines = 0 + $c =~ /\n/gs;
|
my @newlines = ($c =~ /\n/gs);
|
||||||
|
my $cond_lines = 1 + $#newlines;
|
||||||
|
|
||||||
# We want to check the first line inside the block
|
# We want to check the first line inside the block
|
||||||
# starting at the end of the conditional, so remove:
|
# starting at the end of the conditional, so remove:
|
||||||
|
|
Loading…
Reference in a new issue