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.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e07f5e0c5df4..594b419b7d20 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -82,10 +82,18 @@
82 __x - (__x % (y)); \ 82 __x - (__x % (y)); \
83} \ 83} \
84) 84)
85
86/*
87 * Divide positive or negative dividend by positive divisor and round
88 * to closest integer. Result is undefined for negative divisors.
89 */
85#define DIV_ROUND_CLOSEST(x, divisor)( \ 90#define DIV_ROUND_CLOSEST(x, divisor)( \
86{ \ 91{ \
87 typeof(divisor) __divisor = divisor; \ 92 typeof(x) __x = x; \
88 (((x) + ((__divisor) / 2)) / (__divisor)); \ 93 typeof(divisor) __d = divisor; \
94 (((typeof(x))-1) >= 0 || (__x) >= 0) ? \
95 (((__x) + ((__d) / 2)) / (__d)) : \
96 (((__x) - ((__d) / 2)) / (__d)); \
89} \ 97} \
90) 98)
91 99
@@ -377,7 +385,6 @@ extern enum system_states {
377 SYSTEM_HALT, 385 SYSTEM_HALT,
378 SYSTEM_POWER_OFF, 386 SYSTEM_POWER_OFF,
379 SYSTEM_RESTART, 387 SYSTEM_RESTART,
380 SYSTEM_SUSPEND_DISK,
381} system_state; 388} system_state;
382 389
383#define TAINT_PROPRIETARY_MODULE 0 390#define TAINT_PROPRIETARY_MODULE 0