debugfs: Add debugfs_create_u64()
[powerpc.git] / include / asm-generic / bug.h
index a525089..14fae1f 100644 (file)
@@ -4,6 +4,22 @@
 #include <linux/compiler.h>
 
 #ifdef CONFIG_BUG
+
+#ifdef CONFIG_GENERIC_BUG
+#ifndef __ASSEMBLY__
+struct bug_entry {
+       unsigned long   bug_addr;
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+       const char      *file;
+       unsigned short  line;
+#endif
+       unsigned short  flags;
+};
+#endif         /* __ASSEMBLY__ */
+
+#define BUGFLAG_WARNING        (1<<0)
+#endif /* CONFIG_GENERIC_BUG */
+
 #ifndef HAVE_ARCH_BUG
 #define BUG() do { \
        printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
@@ -19,7 +35,7 @@
 #define WARN_ON(condition) ({                                          \
        typeof(condition) __ret_warn_on = (condition);                  \
        if (unlikely(__ret_warn_on)) {                                  \
-               printk("BUG: warning at %s:%d/%s()\n", __FILE__,        \
+               printk("BUG: at %s:%d %s()\n", __FILE__,                \
                        __LINE__, __FUNCTION__);                        \
                dump_stack();                                           \
        }                                                               \
 #endif
 
 #ifndef HAVE_ARCH_WARN_ON
-#define WARN_ON(condition) unlikely((condition))
+#define WARN_ON(condition) ({                                          \
+       typeof(condition) __ret_warn_on = (condition);                  \
+       unlikely(__ret_warn_on);                                        \
+})
 #endif
 #endif
 
-#define WARN_ON_ONCE(condition)        ({                      \
-       static int __warn_once = 1;                     \
-       typeof(condition) __ret_warn_once = (condition);\
-                                                       \
-       if (likely(__warn_once))                        \
-               if (WARN_ON(__ret_warn_once))           \
-                       __warn_once = 0;                \
-       unlikely(__ret_warn_once);                      \
+#define WARN_ON_ONCE(condition)        ({                              \
+       static int __warned;                                    \
+       typeof(condition) __ret_warn_once = (condition);        \
+                                                               \
+       if (unlikely(__ret_warn_once))                          \
+               if (WARN_ON(!__warned))                         \
+                       __warned = 1;                           \
+       unlikely(__ret_warn_once);                              \
 })
 
 #ifdef CONFIG_SMP