* [PATCH] Btrfs-progs: update BUG_ON and WARN_ON
@ 2008-12-31 6:54 Shen Feng
0 siblings, 0 replies; only message in thread
From: Shen Feng @ 2008-12-31 6:54 UTC (permalink / raw)
To: linux-btrfs
Define BUG_ON and WARN_ON as assert for esay debug.
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
---
kerncompat.h | 5 +++--
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
--
1.6.0.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-12-31 6:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31 6:54 [PATCH] Btrfs-progs: update BUG_ON and WARN_ON Shen Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox