]> git.proxmox.com Git - ovs.git/blob - datapath/linux/compat/include/linux/kernel.h
compat: Remove unsupported kernel compat code
[ovs.git] / datapath / linux / compat / include / linux / kernel.h
1 #ifndef __KERNEL_H_WRAPPER
2 #define __KERNEL_H_WRAPPER 1
3
4 #include_next <linux/kernel.h>
5 #ifndef HAVE_LOG2_H
6 #include <linux/log2.h>
7 #endif
8
9 #include <linux/version.h>
10
11 #ifndef USHRT_MAX
12 #define USHRT_MAX ((u16)(~0U))
13 #define SHRT_MAX ((s16)(USHRT_MAX>>1))
14 #define SHRT_MIN ((s16)(-SHRT_MAX - 1))
15 #endif
16
17 #ifndef DIV_ROUND_UP
18 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
19 #endif
20
21 #ifndef rounddown
22 #define rounddown(x, y) ( \
23 { \
24 typeof(x) __x = (x); \
25 __x - (__x % (y)); \
26 } \
27 )
28 #endif
29
30 /* U32_MAX was introduced in include/linux/kernel.h after version 3.14. */
31 #ifndef U32_MAX
32 #define U32_MAX ((u32)~0U)
33 #endif
34
35 #endif /* linux/kernel.h */