]> err.no Git - linux-2.6/blobdiff - include/asm-generic/bug.h
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6] / include / asm-generic / bug.h
index 0cd9711895faaf6259baeaf3a66cf6484d41804a..8ceab7bcd8b4f229f45536f8208e5394c99e9695 100644 (file)
 #endif
 #endif
 
+#define WARN_ON_ONCE(condition)                                \
+({                                                     \
+       static int __warn_once = 1;                     \
+       int __ret = 0;                                  \
+                                                       \
+       if (unlikely((condition) && __warn_once)) {     \
+               __warn_once = 0;                        \
+               WARN_ON(1);                             \
+               __ret = 1;                              \
+       }                                               \
+       __ret;                                          \
+})
+
+#ifdef CONFIG_SMP
+# define WARN_ON_SMP(x)                        WARN_ON(x)
+#else
+# define WARN_ON_SMP(x)                        do { } while (0)
+#endif
+
 #endif