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

checkpatch: handle missing #if open in context

If the #if opening statement is not in the context then the context stack
can be empty.  Handle this by ensuring there is always a blank entry in
the stack.
Signed-off-by: NAndy Whitcroft <apw@canonical.com>
Tested-by: NDhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c91192d6
......@@ -411,13 +411,15 @@ sub ctx_statement_block {
my $type = '';
my $level = 0;
my @stack = ([$type, $level]);
my @stack = ();
my $p;
my $c;
my $len = 0;
my $remainder;
while (1) {
@stack = (['', 0]) if ($#stack == -1);
#warn "CSB: blk<$blk> remain<$remain>\n";
# If we are about to drop off the end, pull in more
# context.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册