Statement should end at a close brace at the outermost level in ctx_statement_block.
The way to reproduce the bug, 1, Add two external function declarations into line 505 of kernel/stop_machine.c, such as, int foo1(void); int foo2(void); 2, Format a patch for that, and use the checkpatch.pl to check. 3, The first declaration(foo1()) would not be warned, because the statement does not end at the '}' before it. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262..f220cfc 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1330,7 +1330,7 @@ sub ctx_statement_block { # Statement ends at the ';' or a close '}' at the # outermost level. - if ($level == 0 && $c eq ';') { + if ($level == 0 && ($c eq ';' || $c eq '}')) { last; } -- 2.7.4