aboutsummaryrefslogtreecommitdiffstats
path: root/kerncompat.h
diff options
context:
space:
mode:
authorShen Feng <shen@cn.fujitsu.com>2009-01-07 14:57:12 -0500
committerChris Mason <chris.mason@oracle.com>2009-01-07 14:57:12 -0500
commitdb6772f4d307df948e503708aded11df0c9b6438 (patch)
tree0394aa4e42e0cdde314fb3ae46181f8e6f6fc089 /kerncompat.h
parent9a6930e9bedb930ac44e540ef7f5633b61d270c2 (diff)
downloadbtrfs-progs-db6772f4d307df948e503708aded11df0c9b6438.tar.gz
btrfs-progs-db6772f4d307df948e503708aded11df0c9b6438.tar.xz
btrfs-progs-db6772f4d307df948e503708aded11df0c9b6438.zip
Update BUG_ON and WARN_ON
Define BUG_ON and WARN_ON as assert for easy debugging. Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Diffstat (limited to 'kerncompat.h')
-rw-r--r--kerncompat.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/kerncompat.h b/kerncompat.h
index e6e9987..aed4b55 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -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