Skip to content

Commit de323f2

Browse files
akpm00michal42
authored andcommitted
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>
1 parent a1087ef commit de323f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/headers_check.pl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ sub check_include
6464

6565
sub check_declarations
6666
{
67-
if ($line =~m/^\s*extern\b/) {
67+
if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
6868
printf STDERR "$filename:$lineno: " .
6969
"userspace cannot call function or variable " .
7070
"defined in the kernel\n";

0 commit comments

Comments
 (0)