Commit 0fffce8f authored by Linus Torvalds's avatar Linus Torvalds

Make a polite version of BUG_ON() - WARN_ON() which doesn't

kill the machine.

Damn I hate people who kill the machine for no good reason. 
parent fcaf0e9c
...@@ -136,7 +136,7 @@ void put_device(struct device * dev) ...@@ -136,7 +136,7 @@ void put_device(struct device * dev)
list_del_init(&dev->g_list); list_del_init(&dev->g_list);
up(&device_sem); up(&device_sem);
BUG_ON((dev->state != DEVICE_GONE)); WARN_ON(dev->state != DEVICE_GONE);
device_del(dev); device_del(dev);
} }
......
...@@ -200,6 +200,12 @@ struct sysinfo { ...@@ -200,6 +200,12 @@ struct sysinfo {
}; };
#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#define WARN_ON(condition) do { \
if (unlikely((condition)!=0)) { \
printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
dump_stack(); \
} \
} while (0)
extern void BUILD_BUG(void); extern void BUILD_BUG(void);
#define BUILD_BUG_ON(condition) do { if (condition) BUILD_BUG(); } while(0) #define BUILD_BUG_ON(condition) do { if (condition) BUILD_BUG(); } while(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment