1 #ifndef _ASM_GENERIC_BUG_H
2 #define _ASM_GENERIC_BUG_H
4 #include <linux/compiler.h>
7 extern const char *print_tainted(void);
13 printk("BUG: failure at %s:%d/%s()! (%s)\n", __FILE__, __LINE__, __FUNCTION__, print_tainted()); \
18 #ifndef HAVE_ARCH_BUG_ON
19 #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
22 #ifndef HAVE_ARCH_WARN_ON
23 #define WARN_ON(condition) do { \
24 if (unlikely((condition)!=0)) { \
25 printk("BUG: warning at %s:%d/%s() (%s)\n", __FILE__, __LINE__, __FUNCTION__, print_tainted()); \
31 #else /* !CONFIG_BUG */
36 #ifndef HAVE_ARCH_BUG_ON
37 #define BUG_ON(condition) do { \
38 if (unlikely((condition)!=0)) { \
39 printk("BUGging on (%s)\n", #condition); \
45 #ifndef HAVE_ARCH_WARN_ON
46 #define WARN_ON(condition) do { \
47 if (unlikely((condition)!=0)) { \
48 printk("BUG: warning: (%s) at %s:%d/%s()\n", \
49 #condition, __FILE__, __LINE__, __FUNCTION__); \
56 #define WARN_ON_ONCE(condition) \
58 static int __warn_once = 1; \
61 if (unlikely((condition) && __warn_once)) { \
70 # define WARN_ON_SMP(x) WARN_ON(x)
72 # define WARN_ON_SMP(x) do { } while (0)