From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: [PATCH 5/7] CacheFiles: Use new core assertion macros Date: Fri, 16 Dec 2011 14:14:39 +0000 Message-ID: <20111216141438.24668.78768.stgit@warthog.procyon.org.uk> References: <20111216141357.24668.49793.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19185 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759212Ab1LPOOr (ORCPT ); Fri, 16 Dec 2011 09:14:47 -0500 In-Reply-To: <20111216141357.24668.49793.stgit@warthog.procyon.org.uk> Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-arch@vger.kernel.org, mingo@elte.hu Cc: linux-kernel@vger.kernel.org, David Howells Make CacheFiles use the new core assertion macros in place of its own. Signed-off-by: David Howells --- fs/cachefiles/internal.h | 53 ++-------------------------------------------- 1 files changed, 2 insertions(+), 51 deletions(-) diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index bd6bc1b..fd88085 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h @@ -14,6 +14,8 @@ #include #include #include +#define ENABLE_ASSERTIONS +#include struct cachefiles_cache; struct cachefiles_object; @@ -301,54 +303,3 @@ do { \ #define _leave(FMT, ...) no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__) #define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__) #endif - -#if 1 /* defined(__KDEBUGALL) */ - -#define ASSERT(X) \ -do { \ - if (unlikely(!(X))) { \ - printk(KERN_ERR "\n"); \ - printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ - BUG(); \ - } \ -} while (0) - -#define ASSERTCMP(X, OP, Y) \ -do { \ - if (unlikely(!((X) OP (Y)))) { \ - printk(KERN_ERR "\n"); \ - printk(KERN_ERR "CacheFiles: Assertion failed\n"); \ - printk(KERN_ERR "%lx " #OP " %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 "CacheFiles: 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 "CacheFiles: Assertion failed\n"); \ - printk(KERN_ERR "%lx " #OP " %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