提交 6f779c18 编写于 作者: A Andy Whitcroft 提交者: Linus Torvalds

checkpatch: suspect indent count condition lines correctly

Correct calculation of the number of lines of condition where we have
suspect indent.
Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册