[PATCH] bcachefs: Remove redundant null pointer checks in bch2_fs_debug_init()

Zhen Ni <[email protected]> Fri, 29 Aug 2025 11:53:26 +0800
Newsgroups org.kernel.vger.linux-bcachefs
Message-ID <[email protected]>
Since the debugfs_create_dir() never returns a null pointer, checking
the return value for a null pointer is redundant, and using IS_ERR is
safe enough.

Signed-off-by: Zhen Ni <[email protected]>
---
 fs/bcachefs/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index 07c2a0f73cc2..3aa53a3b5208 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -943,7 +943,7 @@ void bch2_fs_debug_init(struct bch_fs *c)
 		strscpy(name, c->name, sizeof(name));
 
 	c->fs_debug_dir = debugfs_create_dir(name, bch_debug);
-	if (IS_ERR_OR_NULL(c->fs_debug_dir))
+	if (IS_ERR(c->fs_debug_dir))
 		return;
 
 	debugfs_create_file("cached_btree_nodes", 0400, c->fs_debug_dir,
@@ -970,7 +970,7 @@ void bch2_fs_debug_init(struct bch_fs *c)
 	bch2_fs_async_obj_debugfs_init(c);
 
 	c->btree_debug_dir = debugfs_create_dir("btrees", c->fs_debug_dir);
-	if (IS_ERR_OR_NULL(c->btree_debug_dir))
+	if (IS_ERR(c->btree_debug_dir))
 		return;
 
 	for (bd = c->btree_debug;
-- 
2.20.1