提交 de323f22 编写于 作者: A akpm@linux-foundation.org 提交者: Michal Marek

headers_check: better search for functions in headers

Some headers don't bother with "extern" in function prototypes, which
results in said prototypes being unnoticed and exported to userland.

This patch slightly improves detection of such cases by checking for C
type names as well in the beginning of a line.
Signed-off-by: NAlexander Shishkin <virtuoso@slind.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: WANG Cong <amwang@redhat.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 a1087ef6
...@@ -64,7 +64,7 @@ sub check_include ...@@ -64,7 +64,7 @@ sub check_include
sub check_declarations sub check_declarations
{ {
if ($line =~m/^\s*extern\b/) { if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
printf STDERR "$filename:$lineno: " . printf STDERR "$filename:$lineno: " .
"userspace cannot call function or variable " . "userspace cannot call function or variable " .
"defined in the kernel\n"; "defined in the kernel\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册