[PATCH 22/23] rbd: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code

Chunguang Xu
2020-08-27T10:15:38Z

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