Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
#
# 2) It is checked that prototypes does not use "extern"
#
-# 3) TODO: check for leaked CONFIG_ symbols
+# 3) Check for leaked CONFIG_ symbols
use strict;
$lineno++;
check_include();
check_prototypes();
+ check_config();
}
close FH;
}
printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
}
}
+
+sub check_config
+{
+ if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9]+)[^a-zA-Z0-9]/) {
+ printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n";
+ }
+}
+