Skip to content

Commit 3eba5e0

Browse files
Coly Liaxboe
authored andcommitted
bcache: avoid NULL checking to c->root in run_cache_set()
In run_cache_set() after c->root returned from bch_btree_node_get(), it is checked by IS_ERR_OR_NULL(). Indeed it is unncessary to check NULL because bch_btree_node_get() will not return NULL pointer to caller. This patch replaces IS_ERR_OR_NULL() by IS_ERR() for the above reason. Signed-off-by: Coly Li <colyli@suse.de> Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 31f5b95 commit 3eba5e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/md/bcache/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,7 +2018,7 @@ static int run_cache_set(struct cache_set *c)
20182018
c->root = bch_btree_node_get(c, NULL, k,
20192019
j->btree_level,
20202020
true, NULL);
2021-
if (IS_ERR_OR_NULL(c->root))
2021+
if (IS_ERR(c->root))
20222022
goto err;
20232023

20242024
list_del_init(&c->root->list);

0 commit comments

Comments
 (0)