From: Shen Feng <shen@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs-progs: update BUG_ON and WARN_ON
Date: Wed, 31 Dec 2008 14:54:15 +0800 [thread overview]
Message-ID: <495B1717.7020404@cn.fujitsu.com> (raw)
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
reply other threads:[~2008-12-31 6:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=495B1717.7020404@cn.fujitsu.com \
--to=shen@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox