From d264804db2b530ce4206c5e811cd65c0879546d1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 27 Dec 2008 19:52:20 +0100 Subject: [PATCH] --- yaml --- r: 125431 b: refs/heads/master c: 7e557a2509f9e1477c10295b74e29e4e93fa2392 h: refs/heads/master i: 125429: ed09cb62b3af28439c99f334331c7bf9220a4e12 125427: 1e56d277c35d8fcf1456db1651b2d4f99e1e30c8 125423: 16ffdefdd71883f86daf5ab2d85ddf28ed699fdb v: v3 --- [refs] | 2 +- trunk/scripts/headers_check.pl | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a7127f5f5578..5960f935696b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46b8af50ba5c072b74740c5fa8ba08e6eabb22f8 +refs/heads/master: 7e557a2509f9e1477c10295b74e29e4e93fa2392 diff --git a/trunk/scripts/headers_check.pl b/trunk/scripts/headers_check.pl index 5bdd9753007a..72924a7fcf1e 100644 --- a/trunk/scripts/headers_check.pl +++ b/trunk/scripts/headers_check.pl @@ -16,7 +16,7 @@ # # 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; @@ -36,6 +36,7 @@ $lineno++; check_include(); check_prototypes(); + check_config(); } close FH; } @@ -64,3 +65,11 @@ sub check_prototypes 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"; + } +} +