[PATCH 2/8] headers_check: add check for kernel integer types

From: Paul Bolle
Date: Mon Apr 01 2013 - 13:57:27 EST


The u8, u16, u32, and u64, and the s8, s16, s32, and s64 types shouldn't
be exported to userspace. Add a simple check for these.

Signed-off-by: Paul Bolle <pebolle@xxxxxxxxxx>
---
scripts/headers_check.pl | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 64ac238..317aa3a 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -39,6 +39,7 @@ foreach my $file (@files) {
&check_include();
&check_asm_types();
&check_sizetypes();
+ &check_kerneltypes();
&check_declarations();
# Dropped for now. Too much noise &check_config();
}
@@ -159,3 +160,12 @@ sub check_sizetypes
#$ret = 1;
}
}
+
+sub check_kerneltypes
+{
+ if ($line =~ m/^[[:space:]]*([us](8|16|32|64))\b/) {
+ printf STDERR "$filename:$lineno: " .
+ "found $1 type exported to userspace; " .
+ "use __$1 instead\n";
+ }
+}
--
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/