From: Stanislaw Gruszka Date: Fri, 15 Jul 2011 15:50:25 +0000 (+0200) Subject: compat: add pr__once macros X-Git-Tag: compat-2011-09-28~24 X-Git-Url: https://git.openfabrics.org/?p=~tnikolova%2Fcompat%2F.git;a=commitdiff_plain;h=807b8b85d0d51abbb6cafd1bc964c29e2f8240f2 compat: add pr__once macros Add functions from 2.6.38 kernel commit: commit 16cb839f13324978bd58082e69de81a711802b11 Author: Joe Perches Date: Wed Jan 12 16:59:46 2011 -0800 include/linux/printk.h: add pr__once macros Signed-off-by: Stanislaw Gruszka --- diff --git a/include/linux/compat-2.6.38.h b/include/linux/compat-2.6.38.h index 2dd1910..dfe1250 100644 --- a/include/linux/compat-2.6.38.h +++ b/include/linux/compat-2.6.38.h @@ -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 */