Commit 6f779c18 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds
Browse files

checkpatch: suspect indent count condition lines correctly

Correct calculation of the number of lines of condition where we have
suspect indent.
Signed-off-by: default avatarAndy Whitcroft <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5368df20
......@@ -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:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment