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.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 64ce58bee6f5..3a5b48e52a9e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -103,6 +103,18 @@
103 (((__x) - ((__d) / 2)) / (__d)); \ 103 (((__x) - ((__d) / 2)) / (__d)); \
104} \ 104} \
105) 105)
106/*
107 * Same as above but for u64 dividends. divisor must be a 32-bit
108 * number.
109 */
110#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \
111{ \
112 typeof(divisor) __d = divisor; \
113 unsigned long long _tmp = (x) + (__d) / 2; \
114 do_div(_tmp, __d); \
115 _tmp; \
116} \
117)
106 118
107/* 119/*
108 * Multiplies an integer by a fraction, while avoiding unnecessary 120 * Multiplies an integer by a fraction, while avoiding unnecessary
@@ -471,6 +483,7 @@ extern enum system_states {
471#define TAINT_OOT_MODULE 12 483#define TAINT_OOT_MODULE 12
472#define TAINT_UNSIGNED_MODULE 13 484#define TAINT_UNSIGNED_MODULE 13
473#define TAINT_SOFTLOCKUP 14 485#define TAINT_SOFTLOCKUP 14
486#define TAINT_LIVEPATCH 15
474 487
475extern const char hex_asc[]; 488extern const char hex_asc[];
476#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 489#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
@@ -799,9 +812,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
799 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 812 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
800 (type *)( (char *)__mptr - offsetof(type,member) );}) 813 (type *)( (char *)__mptr - offsetof(type,member) );})
801 814
802/* Trap pasters of __FUNCTION__ at compile-time */
803#define __FUNCTION__ (__func__)
804
805/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ 815/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
806#ifdef CONFIG_FTRACE_MCOUNT_RECORD 816#ifdef CONFIG_FTRACE_MCOUNT_RECORD
807# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 817# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD