Skip to content

Commit

Permalink
[PATCH] mutex subsystem, add typecheck_fn(type, function)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuck Ebbert authored and Ingo Molnar committed Jan 9, 2006
1 parent ffbf670 commit 711a660
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 711a660

Please sign in to comment.