bcachefs: Remove redundant null pointer checks in bch2_fs_debug_init()
PATCH 1/1 bcachefs: Remove redundant null pointer checks in bch2_fs_debug_init()
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(-)
fs/bcachefs/debug.c +2 -2
@@ -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;
Signature · 1 line
2.20.1