summaryrefslogtreecommitdiff
path: root/datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h
diff options
context:
space:
mode:
Diffstat (limited to 'datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h')
-rw-r--r--datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h b/datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h
new file mode 100644
index 000000000..1d9b31401
--- /dev/null
+++ b/datapath/linux-2.6/compat-2.6/include/asm-generic/bug.h
@@ -0,0 +1,19 @@
+#ifndef __ASM_GENERIC_BUG_WRAPPER_H
+#define __ASM_GENERIC_BUG_WRAPPER_H
+
+#include_next <asm-generic/bug.h>
+
+#ifndef WARN_ON_ONCE
+#define WARN_ON_ONCE(condition) ({ \
+ static int __warned; \
+ int __ret_warn_once = !!(condition); \
+ \
+ if (unlikely(__ret_warn_once) && !__warned) { \
+ WARN_ON(1); \
+ __warned = 1; \
+ } \
+ unlikely(__ret_warn_once); \
+})
+#endif
+
+#endif