[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1566d951b3b1ea93cd2cd9e88e29289cbbd40584.1598518912.git.brookxu@tencent.com>
Date: Thu, 27 Aug 2020 18:14:27 +0800
From: Chunguang Xu <brookxu.cn@...il.com>
To: arnd@...db.de
Cc: rppt@...nel.org, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 22/23] rbd: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code
Since ASSERT_FAIL() and ASSERT_WARN() have been provided, ASSERT()
may be realized through them, thus reducing code redundancy and
facilitating problem analysis.
Signed-off-by: Chunguang Xu <brookxu@...cent.com>
---
drivers/block/rbd.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d9c0e7d..798b9ad 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -617,14 +617,7 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
}
#ifdef RBD_DEBUG
-#define rbd_assert(expr) \
- if (unlikely(!(expr))) { \
- printk(KERN_ERR "\nAssertion failure in %s() " \
- "at line %d:\n\n" \
- "\trbd_assert(%s);\n\n", \
- __func__, __LINE__, #expr); \
- BUG(); \
- }
+#define rbd_assert(expr) ASSERT_FAIL(expr)
#else /* !RBD_DEBUG */
# define rbd_assert(expr) ((void) 0)
#endif /* !RBD_DEBUG */
--
1.8.3.1
Powered by blists - more mailing lists