]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] mutex subsystem, add typecheck_fn(type, function)
authorChuck Ebbert <76306.1226@compuserve.com>
Mon, 9 Jan 2006 23:59:17 +0000 (15:59 -0800)
committerIngo Molnar <mingo@hera.kernel.org>
Mon, 9 Jan 2006 23:59:17 +0000 (15:59 -0800)
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>
include/linux/kernel.h

index ca7ff8fdd0907b8760fb5f656f50146beb387c42..d0e6ca3b00ef0510b13b308640ba8b1eff2efcce 100644 (file)
@@ -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