summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-01-30 08:10:44 -0800
committerLuis R. Rodriguez <lrodriguez@atheros.com>2009-01-30 08:10:44 -0800
commit4f17e2abd6d313b53aa2cea6ac49de72ea7fe40a (patch)
tree5a7a00580d5d150101c53deceb4b673abdec3ec0
parent540d36ec9bdfa4cca5f3627f81423a159644c9f6 (diff)
Adds WARN_ONCE
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
-rw-r--r--compat/compat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/compat/compat.h b/compat/compat.h
index 1165f283..7e4b9b13 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -14,6 +14,18 @@
#include <linux/pci.h>
+#ifndef WARN_ONCE
+#define WARN_ONCE(condition, format...) ({ \
+ static int __warned; \
+ int __ret_warn_once = !!(condition); \
+ \
+ if (unlikely(__ret_warn_once)) \
+ if (WARN(!__warned, format)) \
+ __warned = 1; \
+ unlikely(__ret_warn_once); \
+})
+#endif /* From include/asm-generic/bug.h */
+
void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */