[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111216141459.24668.91001.stgit@warthog.procyon.org.uk>
Date: Fri, 16 Dec 2011 14:14:59 +0000
From: David Howells <dhowells@...hat.com>
To: linux-arch@...r.kernel.org, mingo@...e.hu
Cc: linux-kernel@...r.kernel.org, David Howells <dhowells@...hat.com>
Subject: [PATCH 7/7] RxRPC: Use new core assertion macros
Make RxRPC use the new core assertion macros in place of its own.
Signed-off-by: David Howells <dhowells@...hat.com>
---
net/rxrpc/ar-internal.h | 71 +----------------------------------------------
1 files changed, 2 insertions(+), 69 deletions(-)
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 8e22bd3..b86fe78 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -10,6 +10,8 @@
*/
#include <rxrpc/packet.h>
+#define ENABLE_ASSERTIONS
+#include <linux/assert.h>
#if 0
#define CHECK_SLAB_OKAY(X) \
@@ -657,75 +659,6 @@ do { \
#endif
/*
- * debug assertion checking
- */
-#if 1 // defined(__KDEBUGALL)
-
-#define ASSERT(X) \
-do { \
- if (unlikely(!(X))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "RxRPC: Assertion failed\n"); \
- BUG(); \
- } \
-} while(0)
-
-#define ASSERTCMP(X, OP, Y) \
-do { \
- if (unlikely(!((X) OP (Y)))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "RxRPC: Assertion failed\n"); \
- printk(KERN_ERR "%lu " #OP " %lu is false\n", \
- (unsigned long)(X), (unsigned long)(Y)); \
- printk(KERN_ERR "0x%lx " #OP " 0x%lx is false\n", \
- (unsigned long)(X), (unsigned long)(Y)); \
- BUG(); \
- } \
-} while(0)
-
-#define ASSERTIF(C, X) \
-do { \
- if (unlikely((C) && !(X))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "RxRPC: Assertion failed\n"); \
- BUG(); \
- } \
-} while(0)
-
-#define ASSERTIFCMP(C, X, OP, Y) \
-do { \
- if (unlikely((C) && !((X) OP (Y)))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "RxRPC: Assertion failed\n"); \
- printk(KERN_ERR "%lu " #OP " %lu is false\n", \
- (unsigned long)(X), (unsigned long)(Y)); \
- printk(KERN_ERR "0x%lx " #OP " 0x%lx is false\n", \
- (unsigned long)(X), (unsigned long)(Y)); \
- BUG(); \
- } \
-} while(0)
-
-#else
-
-#define ASSERT(X) \
-do { \
-} while(0)
-
-#define ASSERTCMP(X, OP, Y) \
-do { \
-} while(0)
-
-#define ASSERTIF(C, X) \
-do { \
-} while(0)
-
-#define ASSERTIFCMP(C, X, OP, Y) \
-do { \
-} while(0)
-
-#endif /* __KDEBUGALL */
-
-/*
* socket buffer accounting / leak finding
*/
static inline void __rxrpc_new_skb(struct sk_buff *skb, const char *fn)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists