Thread (31 messages) 31 messages, 2 authors, 2020-08-28
STALE2101d

[PATCH 21/23] ext4: use ASSERT_FAIL()/ASSERT_WARN() to cleanup some code

From: Chunguang Xu <hidden>
Date: 2020-08-27 10:15:24
Also in: lkml
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help