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 21/23] ext4: 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>
---
fs/ext4/mballoc.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index c0a331e..99976e6 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -591,15 +591,7 @@ static inline void mb_group_bb_bitmap_free(struct ext4_group_info *grp)

#ifdef AGGRESSIVE_CHECK

-#define MB_CHECK_ASSERT(assert) \
-do { \
- if (!(assert)) { \
- printk(KERN_EMERG \
- "Assertion failure in %s() at %s:%d: \"%s\"\n", \
- function, file, line, # assert); \
- BUG(); \
- } \
-} while (0)
+#define MB_CHECK_ASSERT(assert) ASSERT_FAIL(assert)

static int __mb_check_buddy(struct ext4_buddy *e4b, char *file,
const char *function, int line)
--
1.8.3.1
\
 
 \ /
  Last update: 2020-08-27 12:15    [W:0.216 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site