aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f9cd7a513f9c..5c4b1251e110 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -14,6 +14,7 @@
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/log2.h> 16#include <linux/log2.h>
17#include <linux/typecheck.h>
17#include <asm/byteorder.h> 18#include <asm/byteorder.h>
18#include <asm/bug.h> 19#include <asm/bug.h>
19 20
@@ -441,26 +442,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
441 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 442 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
442 (type *)( (char *)__mptr - offsetof(type,member) );}) 443 (type *)( (char *)__mptr - offsetof(type,member) );})
443 444
444/*
445 * Check at compile time that something is of a particular type.
446 * Always evaluates to 1 so you may use it easily in comparisons.
447 */
448#define typecheck(type,x) \
449({ type __dummy; \
450 typeof(x) __dummy2; \
451 (void)(&__dummy == &__dummy2); \
452 1; \
453})
454
455/*
456 * Check at compile time that 'function' is a certain type, or is a pointer
457 * to that type (needs to use typedef for the function type.)
458 */
459#define typecheck_fn(type,function) \
460({ typeof(type) __tmp = function; \
461 (void)__tmp; \
462})
463
464struct sysinfo; 445struct sysinfo;
465extern int do_sysinfo(struct sysinfo *info); 446extern int do_sysinfo(struct sysinfo *info);
466 447