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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux