* [PATCH] bcachefs: Remove redundant null pointer checks in bch2_fs_debug_init()
@ 2025-08-29 3:53 Zhen Ni
0 siblings, 0 replies; only message in thread
From: Zhen Ni @ 2025-08-29 3:53 UTC (permalink / raw)
To: kent.overstreet; +Cc: linux-bcachefs, Zhen Ni
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 <zhen.ni@easystack.cn>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-29 6:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29 3:53 [PATCH] bcachefs: Remove redundant null pointer checks in bch2_fs_debug_init() Zhen Ni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).