diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f9cd7a513f9c..fdbbf72ca2eb 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -14,6 +14,8 @@ | |||
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> | ||
18 | #include <linux/ratelimit.h> | ||
17 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
18 | #include <asm/bug.h> | 20 | #include <asm/bug.h> |
19 | 21 | ||
@@ -188,11 +190,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
188 | asmlinkage int printk(const char * fmt, ...) | 190 | asmlinkage int printk(const char * fmt, ...) |
189 | __attribute__ ((format (printf, 1, 2))) __cold; | 191 | __attribute__ ((format (printf, 1, 2))) __cold; |
190 | 192 | ||
191 | extern int printk_ratelimit_jiffies; | 193 | extern struct ratelimit_state printk_ratelimit_state; |
192 | extern int printk_ratelimit_burst; | ||
193 | extern int printk_ratelimit(void); | 194 | extern int printk_ratelimit(void); |
194 | extern int __ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
195 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
196 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 195 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
197 | unsigned int interval_msec); | 196 | unsigned int interval_msec); |
198 | #else | 197 | #else |
@@ -203,8 +202,6 @@ static inline int printk(const char *s, ...) | |||
203 | __attribute__ ((format (printf, 1, 2))); | 202 | __attribute__ ((format (printf, 1, 2))); |
204 | static inline int __cold printk(const char *s, ...) { return 0; } | 203 | static inline int __cold printk(const char *s, ...) { return 0; } |
205 | static inline int printk_ratelimit(void) { return 0; } | 204 | static inline int printk_ratelimit(void) { return 0; } |
206 | static inline int __printk_ratelimit(int ratelimit_jiffies, \ | ||
207 | int ratelimit_burst) { return 0; } | ||
208 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | 205 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ |
209 | unsigned int interval_msec) \ | 206 | unsigned int interval_msec) \ |
210 | { return false; } | 207 | { return false; } |
@@ -441,26 +438,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
441 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | 438 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
442 | (type *)( (char *)__mptr - offsetof(type,member) );}) | 439 | (type *)( (char *)__mptr - offsetof(type,member) );}) |
443 | 440 | ||
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 | |||
464 | struct sysinfo; | 441 | struct sysinfo; |
465 | extern int do_sysinfo(struct sysinfo *info); | 442 | extern int do_sysinfo(struct sysinfo *info); |
466 | 443 | ||