diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 645231c373c8..e07f5e0c5df4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -35,9 +35,12 @@ | |||
35 | #define LLONG_MAX ((long long)(~0ULL>>1)) | 35 | #define LLONG_MAX ((long long)(~0ULL>>1)) |
36 | #define LLONG_MIN (-LLONG_MAX - 1) | 36 | #define LLONG_MIN (-LLONG_MAX - 1) |
37 | #define ULLONG_MAX (~0ULL) | 37 | #define ULLONG_MAX (~0ULL) |
38 | #define SIZE_MAX (~(size_t)0) | ||
38 | 39 | ||
39 | #define STACK_MAGIC 0xdeadbeef | 40 | #define STACK_MAGIC 0xdeadbeef |
40 | 41 | ||
42 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | ||
43 | |||
41 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) | 44 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) |
42 | #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) | 45 | #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) |
43 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 46 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
@@ -480,15 +483,16 @@ do { \ | |||
480 | 483 | ||
481 | #define trace_printk(fmt, args...) \ | 484 | #define trace_printk(fmt, args...) \ |
482 | do { \ | 485 | do { \ |
486 | static const char *trace_printk_fmt \ | ||
487 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
488 | __builtin_constant_p(fmt) ? fmt : NULL; \ | ||
489 | \ | ||
483 | __trace_printk_check_format(fmt, ##args); \ | 490 | __trace_printk_check_format(fmt, ##args); \ |
484 | if (__builtin_constant_p(fmt)) { \ | ||
485 | static const char *trace_printk_fmt \ | ||
486 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
487 | __builtin_constant_p(fmt) ? fmt : NULL; \ | ||
488 | \ | 491 | \ |
492 | if (__builtin_constant_p(fmt)) \ | ||
489 | __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ | 493 | __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ |
490 | } else \ | 494 | else \ |
491 | __trace_printk(_THIS_IP_, fmt, ##args); \ | 495 | __trace_printk(_THIS_IP_, fmt, ##args); \ |
492 | } while (0) | 496 | } while (0) |
493 | 497 | ||
494 | extern __printf(2, 3) | 498 | extern __printf(2, 3) |