1 #ifndef _ASM_GENERIC_BUG_H
2 #define _ASM_GENERIC_BUG_H
4 #include <linux/compiler.h>
9 printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
14 #ifndef HAVE_ARCH_BUG_ON
15 #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
18 #ifndef HAVE_ARCH_WARN_ON
19 #define WARN_ON(condition) do { \
20 if (unlikely((condition)!=0)) { \
21 printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \
27 #else /* !CONFIG_BUG */
32 #ifndef HAVE_ARCH_BUG_ON
33 #define BUG_ON(condition) do { if (condition) ; } while(0)
36 #ifndef HAVE_ARCH_WARN_ON
37 #define WARN_ON(condition) do { if (condition) ; } while(0)
41 #define WARN_ON_ONCE(condition) \
43 static int __warn_once = 1; \
46 if (unlikely((condition) && __warn_once)) { \
55 # define WARN_ON_SMP(x) WARN_ON(x)
57 # define WARN_ON_SMP(x) do { } while (0)