diff options
author | Jesse Gross <jesse@nicira.com> | 2010-08-30 10:56:49 -0700 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2010-08-30 13:23:08 -0700 |
commit | 717d33b99ee3a35f8160c6551931154d3a062910 (patch) | |
tree | 9e82837738a23dd4509f91eed46e91b571689d6a | |
parent | d295e8e97acae13552a5b220d3fbcff8201064a2 (diff) | |
download | openvswitch-717d33b99ee3a35f8160c6551931154d3a062910.tar.gz |
datapath: Add compat functions for pr_*.
In the earliest kernels that we support this family of macros
wasn't defined at all. Later they were defined but did not include
the module name. Finally, pr_warn was made a synonym for pr_warning.
This harmonizes the behavior across all kernels.
Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r-- | datapath/linux-2.6/compat-2.6/include/linux/kernel.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h index 9459155d6..1f65c099a 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h @@ -6,4 +6,35 @@ #include <linux/log2.h> #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) +#undef pr_emerg +#define pr_emerg(fmt, ...) \ + printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_alert +#define pr_alert(fmt, ...) \ + printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_crit +#define pr_crit(fmt, ...) \ + printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_err +#define pr_err(fmt, ...) \ + printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_warning +#define pr_warning(fmt, ...) \ + printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_notice +#define pr_notice(fmt, ...) \ + printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_info +#define pr_info(fmt, ...) \ + printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#undef pr_cont +#define pr_cont(fmt, ...) \ + printk(KERN_CONT fmt, ##__VA_ARGS__) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +#define pr_warn pr_warning +#endif + #endif /* linux/kernel.h */ |