]> git.neil.brown.name Git - history.git/commitdiff
Make a polite version of BUG_ON() - WARN_ON() which doesn't
authorLinus Torvalds <torvalds@home.transmeta.com>
Fri, 18 Oct 2002 09:28:57 +0000 (02:28 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 18 Oct 2002 09:28:57 +0000 (02:28 -0700)
kill the machine.

Damn I hate people who kill the machine for no good reason.

drivers/base/core.c
include/linux/kernel.h

index bd82a792d87752ce966f33149a0dfd2a5fb1917b..a3ff2d8d34447801791c55038ccc3d4e07585c57 100644 (file)
@@ -136,7 +136,7 @@ void put_device(struct device * dev)
        list_del_init(&dev->g_list);
        up(&device_sem);
 
-       BUG_ON((dev->state != DEVICE_GONE));
+       WARN_ON(dev->state != DEVICE_GONE);
 
        device_del(dev);
 }
index 2def6ba705845d62535fb11c23d3bc148d8f0e65..afa757a3b0a17d4ae55ab2e71f956215ebe97787 100644 (file)
@@ -200,6 +200,12 @@ struct sysinfo {
 };
 
 #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);
 #define BUILD_BUG_ON(condition) do { if (condition) BUILD_BUG(); } while(0)