lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/23] scsi: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code
Date
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@tencent.com>
---
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
\
 
 \ /
  Last update: 2020-08-27 12:19    [W:0.153 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site