diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index cc5e3ffe9fce..8317ec4b9f3b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -24,9 +24,9 @@ | |||
24 | extern const char linux_banner[]; | 24 | extern const char linux_banner[]; |
25 | extern const char linux_proc_banner[]; | 25 | extern const char linux_proc_banner[]; |
26 | 26 | ||
27 | #define USHORT_MAX ((u16)(~0U)) | 27 | #define USHRT_MAX ((u16)(~0U)) |
28 | #define SHORT_MAX ((s16)(USHORT_MAX>>1)) | 28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
29 | #define SHORT_MIN (-SHORT_MAX - 1) | 29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
30 | #define INT_MAX ((int)(~0U>>1)) | 30 | #define INT_MAX ((int)(~0U>>1)) |
31 | #define INT_MIN (-INT_MAX - 1) | 31 | #define INT_MIN (-INT_MAX - 1) |
32 | #define UINT_MAX (~0U) | 32 | #define UINT_MAX (~0U) |
@@ -375,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
375 | return buf; | 375 | return buf; |
376 | } | 376 | } |
377 | 377 | ||
378 | extern int hex_to_bin(char ch); | ||
379 | |||
378 | #ifndef pr_fmt | 380 | #ifndef pr_fmt |
379 | #define pr_fmt(fmt) fmt | 381 | #define pr_fmt(fmt) fmt |
380 | #endif | 382 | #endif |
@@ -389,6 +391,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
389 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 391 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
390 | #define pr_warning(fmt, ...) \ | 392 | #define pr_warning(fmt, ...) \ |
391 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 393 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
394 | #define pr_warn pr_warning | ||
392 | #define pr_notice(fmt, ...) \ | 395 | #define pr_notice(fmt, ...) \ |
393 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 396 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
394 | #define pr_info(fmt, ...) \ | 397 | #define pr_info(fmt, ...) \ |
@@ -423,14 +426,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
423 | * no local ratelimit_state used in the !PRINTK case | 426 | * no local ratelimit_state used in the !PRINTK case |
424 | */ | 427 | */ |
425 | #ifdef CONFIG_PRINTK | 428 | #ifdef CONFIG_PRINTK |
426 | #define printk_ratelimited(fmt, ...) ({ \ | 429 | #define printk_ratelimited(fmt, ...) ({ \ |
427 | static struct ratelimit_state _rs = { \ | 430 | static DEFINE_RATELIMIT_STATE(_rs, \ |
428 | .interval = DEFAULT_RATELIMIT_INTERVAL, \ | 431 | DEFAULT_RATELIMIT_INTERVAL, \ |
429 | .burst = DEFAULT_RATELIMIT_BURST, \ | 432 | DEFAULT_RATELIMIT_BURST); \ |
430 | }; \ | 433 | \ |
431 | \ | 434 | if (__ratelimit(&_rs)) \ |
432 | if (__ratelimit(&_rs)) \ | 435 | printk(fmt, ##__VA_ARGS__); \ |
433 | printk(fmt, ##__VA_ARGS__); \ | ||
434 | }) | 436 | }) |
435 | #else | 437 | #else |
436 | /* No effect, but we still get type checking even in the !PRINTK case: */ | 438 | /* No effect, but we still get type checking even in the !PRINTK case: */ |
@@ -447,6 +449,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
447 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 449 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
448 | #define pr_warning_ratelimited(fmt, ...) \ | 450 | #define pr_warning_ratelimited(fmt, ...) \ |
449 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 451 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
452 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
450 | #define pr_notice_ratelimited(fmt, ...) \ | 453 | #define pr_notice_ratelimited(fmt, ...) \ |
451 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 454 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
452 | #define pr_info_ratelimited(fmt, ...) \ | 455 | #define pr_info_ratelimited(fmt, ...) \ |