Skip to content

Commit

Permalink
checkpatch: suspect indent count condition lines correctly
Browse files Browse the repository at this point in the history
Correct calculation of the number of lines of condition where we have
suspect indent.

Signed-off-by: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
awhitcroft authored and torvalds committed Oct 16, 2008
1 parent 5368df2 commit 6f779c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,8 @@ sub process {
$s =~ s/\n./\n/gs;

# 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
# starting at the end of the conditional, so remove:
Expand Down

0 comments on commit 6f779c1

Please sign in to comment.