From: David Howells <dhowells@redhat.com>
To: linux-arch@vger.kernel.org, mingo@elte.hu
Cc: linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>
Subject: [PATCH 6/7] AFS: Use new core assertion macros
Date: Fri, 16 Dec 2011 14:14:49 +0000 [thread overview]
Message-ID: <20111216141448.24668.82403.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20111216141357.24668.49793.stgit@warthog.procyon.org.uk>
Make AFS use the new core assertion macros in place of its own.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/afs/internal.h | 90 +----------------------------------------------------
1 files changed, 2 insertions(+), 88 deletions(-)
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index d2b0888..36989c0 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -20,6 +20,8 @@
#include <linux/sched.h>
#include <linux/fscache.h>
#include <linux/backing-dev.h>
+#define ENABLE_ASSERTIONS
+#include <linux/assert.h>
#include "afs.h"
#include "afs_vl.h"
@@ -800,91 +802,3 @@ do { \
#define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__)
#define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__)
#endif
-
-/*
- * debug assertion checking
- */
-#if 1 // defined(__KDEBUGALL)
-
-#define ASSERT(X) \
-do { \
- if (unlikely(!(X))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "AFS: Assertion failed\n"); \
- BUG(); \
- } \
-} while(0)
-
-#define ASSERTCMP(X, OP, Y) \
-do { \
- if (unlikely(!((X) OP (Y)))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "AFS: 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 ASSERTRANGE(L, OP1, N, OP2, H) \
-do { \
- if (unlikely(!((L) OP1 (N)) || !((N) OP2 (H)))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "AFS: Assertion failed\n"); \
- printk(KERN_ERR "%lu "#OP1" %lu "#OP2" %lu is false\n", \
- (unsigned long)(L), (unsigned long)(N), \
- (unsigned long)(H)); \
- printk(KERN_ERR "0x%lx "#OP1" 0x%lx "#OP2" 0x%lx is false\n", \
- (unsigned long)(L), (unsigned long)(N), \
- (unsigned long)(H)); \
- BUG(); \
- } \
-} while(0)
-
-#define ASSERTIF(C, X) \
-do { \
- if (unlikely((C) && !(X))) { \
- printk(KERN_ERR "\n"); \
- printk(KERN_ERR "AFS: 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 "AFS: 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 ASSERTRANGE(L, OP1, N, OP2, H) \
-do { \
-} while(0)
-
-#define ASSERTIF(C, X) \
-do { \
-} while(0)
-
-#define ASSERTIFCMP(C, X, OP, Y) \
-do { \
-} while(0)
-
-#endif /* __KDEBUGALL */
next prev parent reply other threads:[~2011-12-16 14:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-16 14:13 [PATCH 1/7] Add conditional oopsing with annotation David Howells
2011-12-16 14:14 ` [PATCH 2/7] Make shrink_dcache_for_umount_subtree() use ANNOTATED_BUG() David Howells
2011-12-16 14:14 ` [PATCH 3/7] Add assertion checking macros David Howells
2011-12-16 14:14 ` David Howells
2011-12-16 21:36 ` Andi Kleen
2011-12-20 15:38 ` David Howells
2011-12-16 14:14 ` [PATCH 4/7] FS-Cache: Use new core assertion macros David Howells
2011-12-16 14:14 ` [PATCH 5/7] CacheFiles: " David Howells
2011-12-16 14:14 ` David Howells [this message]
2011-12-16 14:14 ` [PATCH 6/7] AFS: " David Howells
2011-12-16 14:14 ` [PATCH 7/7] RxRPC: " David Howells
2011-12-16 14:14 ` David Howells
2011-12-17 19:15 ` [PATCH 1/7] Add conditional oopsing with annotation Mike Frysinger
2011-12-17 19:15 ` Mike Frysinger
2011-12-18 8:02 ` Ingo Molnar
2011-12-20 15:34 ` David Howells
-- strict thread matches above, loose matches on Subject: below --
2011-10-12 16:47 [PATCH 1/7] Add assertion support with annotated oopsing David Howells
2011-10-12 16:48 ` [PATCH 6/7] AFS: Use new core assertion macros David Howells
2011-10-12 16:48 ` David Howells
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=20111216141448.24668.82403.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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;
as well as URLs for NNTP newsgroup(s).