Skip to contentSkip to conversation

Btrfs-progs: update BUG_ON and WARN_ON

PATCH New Shen Feng 1 participant 1 message Dec 31, 2008 Btrfs file system

lore
Share & tools
lore

Shen Feng

author
#0 lore raw

PATCH 1/1 Btrfs-progs: update BUG_ON and WARN_ON

Define BUG_ON and WARN_ON as assert for esay debug.

---
 kerncompat.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
kerncompat.h +3 -2
index e6e9987..aed4b55 100644
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <endian.h>
 #include <byteswap.h>
+#include <assert.h>
 
 #ifndef READ
 #define READ 0
@@ -199,8 +200,8 @@ static inline long IS_ERR(const void *ptr)
 #define kstrdup(x, y) strdup(x)
 #define kfree(x) free(x)
 
-#define BUG_ON(c) do { if (c) abort(); } while (0)
-#define WARN_ON(c) do { if (c) abort(); } while (0)
+#define BUG_ON(c) assert(!(c))
+#define WARN_ON(c) assert(!(c))
 
 #undef offsetof
 #ifdef __compiler_offsetof
Signature · 1 line
1.6.0.6