]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: add pr_<level>_once macros
authorStanislaw Gruszka <sgruszka@redhat.com>
Fri, 15 Jul 2011 15:50:25 +0000 (17:50 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 20 Jul 2011 01:07:08 +0000 (18:07 -0700)
Add functions from 2.6.38 kernel commit:

commit 16cb839f13324978bd58082e69de81a711802b11
Author: Joe Perches <joe@perches.com>
Date:   Wed Jan 12 16:59:46 2011 -0800

    include/linux/printk.h: add pr_<level>_once macros

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
include/linux/compat-2.6.38.h

index 2dd19109fcb4d7a4496fa02bda93104b1c14f2ab..dfe12507f8902f7f46c58dfc07855acb16bb064a 100644 (file)
@@ -46,6 +46,31 @@ static inline int skb_checksum_start_offset(const struct sk_buff *skb)
        return skb->csum_start - skb_headroom(skb);
 }
 
+/* from include/linux/printk.h */ 
+#define pr_emerg_once(fmt, ...)                                        \
+       printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_alert_once(fmt, ...)                                        \
+       printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_crit_once(fmt, ...)                                 \
+       printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err_once(fmt, ...)                                  \
+       printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warn_once(fmt, ...)                                 \
+       printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_notice_once(fmt, ...)                               \
+       printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info_once(fmt, ...)                                 \
+       printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_cont_once(fmt, ...)                                 \
+       printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
+#if defined(DEBUG)
+#define pr_debug_once(fmt, ...)                                        \
+       printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_debug_once(fmt, ...)                                        \
+       no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */
 
 #endif /* LINUX_26_38_COMPAT_H */