~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to datapath/linux/compat/include/linux/kernel.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#define pr_warn pr_warning
40
40
#endif
41
41
 
 
42
/*
 
43
 * Print a one-time message (analogous to WARN_ONCE() et al):
 
44
 */
 
45
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
 
46
#undef printk_once
 
47
#define printk_once(fmt, ...)                   \
 
48
({                                              \
 
49
        static bool __print_once;               \
 
50
                                                \
 
51
        if (!__print_once) {                    \
 
52
                __print_once = true;            \
 
53
                printk(fmt, ##__VA_ARGS__);     \
 
54
        }                                       \
 
55
})
 
56
 
 
57
#define pr_emerg_once(fmt, ...)                                 \
 
58
        printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
 
59
#define pr_alert_once(fmt, ...)                                 \
 
60
        printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
 
61
#define pr_crit_once(fmt, ...)                                  \
 
62
        printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
 
63
#define pr_err_once(fmt, ...)                                   \
 
64
        printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
 
65
#define pr_warn_once(fmt, ...)                                  \
 
66
        printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
 
67
#define pr_notice_once(fmt, ...)                                \
 
68
        printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 
69
#define pr_info_once(fmt, ...)                                  \
 
70
        printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
71
#define pr_cont_once(fmt, ...)                                  \
 
72
        printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
 
73
 
 
74
#endif
 
75
 
42
76
#if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
43
77
#error "CONFIG_PREEMPT is broken before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
44
78
#endif