diff options
author | Chuck Ebbert <76306.1226@compuserve.com> | 2006-01-09 15:59:17 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 15:59:17 -0800 |
commit | 711a660dc2064013a2b0167ee67389707fc9cac3 (patch) | |
tree | 1430cbabc0e634c5efceabbe72da426fde8cc5d0 /include | |
parent | ffbf670f5cd50501a34a5187981460da2216071e (diff) | |
download | op-kernel-dev-711a660dc2064013a2b0167ee67389707fc9cac3.zip op-kernel-dev-711a660dc2064013a2b0167ee67389707fc9cac3.tar.gz |
[PATCH] mutex subsystem, add typecheck_fn(type, function)
add typecheck_fn(type, function) to do type-checking of function
pointers.
Modified-by: Ingo Molnar <mingo@elte.hu>
(made it typeof() based, instead of typedef based.)
Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kernel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ca7ff8f..d0e6ca3 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -286,6 +286,15 @@ extern void dump_stack(void); 1; \ }) +/* + * Check at compile time that 'function' is a certain type, or is a pointer + * to that type (needs to use typedef for the function type.) + */ +#define typecheck_fn(type,function) \ +({ typeof(type) __tmp = function; \ + (void)__tmp; \ +}) + #endif /* __KERNEL__ */ #define SI_LOAD_SHIFT 16 |