]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/linux-2.6/compat-2.6/include/linux/kernel.h
ovsdb: Synchronize comments and code in ovsdb_file_commit().
[mirror_ovs.git] / datapath / linux-2.6 / compat-2.6 / include / linux / kernel.h
CommitLineData
064af421
BP
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
e215ebca 9#include <linux/version.h>
717d33b9
JG
10#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
11#undef pr_emerg
12#define pr_emerg(fmt, ...) \
13 printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
14#undef pr_alert
15#define pr_alert(fmt, ...) \
16 printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
17#undef pr_crit
18#define pr_crit(fmt, ...) \
19 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
20#undef pr_err
21#define pr_err(fmt, ...) \
22 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
23#undef pr_warning
24#define pr_warning(fmt, ...) \
25 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
26#undef pr_notice
27#define pr_notice(fmt, ...) \
28 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
29#undef pr_info
30#define pr_info(fmt, ...) \
31 printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
32#undef pr_cont
33#define pr_cont(fmt, ...) \
34 printk(KERN_CONT fmt, ##__VA_ARGS__)
35#endif
36
37#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
38#define pr_warn pr_warning
39#endif
40
982b8810
BP
41#ifndef BUILD_BUG_ON_NOT_POWER_OF_2
42/* Force a compilation error if a constant expression is not a power of 2 */
43#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
44 BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
45#endif
46
f632c8fc
BP
47#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
48#error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
49#endif
50
f45ee2cd
JG
51#ifndef USHRT_MAX
52#define USHRT_MAX ((u16)(~0U))
53#define SHRT_MAX ((s16)(USHRT_MAX>>1))
54#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
55#endif
56
530af29c
JG
57#ifndef DIV_ROUND_UP
58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
59#endif
60
064af421 61#endif /* linux/kernel.h */