Commit de323f22a83b024b7432e813609c6efb74b1bbfc

Authored by akpm@linux-foundation.org
Committed by Michal Marek
1 parent a1087ef6ab

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: 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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

scripts/headers_check.pl
... ... @@ -64,7 +64,7 @@
64 64  
65 65 sub check_declarations
66 66 {
67   - if ($line =~m/^\s*extern\b/) {
  67 + if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
68 68 printf STDERR "$filename:$lineno: " .
69 69 "userspace cannot call function or variable " .
70 70 "defined in the kernel\n";