Skip to content

Commit

Permalink
headers_check: better search for functions in headers
Browse files Browse the repository at this point in the history
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: Alexander 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
akpm@linux-foundation.org authored and Michal Marek committed Dec 14, 2010
1 parent a1087ef commit de323f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/headers_check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub check_include

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: " .
"userspace cannot call function or variable " .
"defined in the kernel\n";
Expand Down

0 comments on commit de323f2

Please sign in to comment.