[PATCH 05/23] scsi: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code

Chunguang Xu
2020-08-27T10:18:49Z

drivers/scsi/megaraid/mega_common.h | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 3a7596e..ba3007d 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -253,16 +253,10 @@

#ifdef DEBUG
#if defined (_ASSERT_PANIC)
-#define ASSERT_ACTION panic
+#define ASSERT(expression) ASSERT_FAIL(expression)
#else
-#define ASSERT_ACTION printk
+#define ASSERT(expression) ASSERT_WARN(expression)
#endif
-
-#define ASSERT(expression) \
- if (!(expression)) { \
- ASSERT_ACTION("assertion failed:(%s), file: %s, line: %d:%s\n", \
- #expression, __FILE__, __LINE__, __func__); \
- }
#else
#define ASSERT(expression)
#endif
--
1.8.3.1