brd: remove a redundant check
Subsystems (2)
PATCH 1/1 brd: remove a redundant check
Because pages[i] can't be NULL, otherwise "pos = pages[i]->index;" will panic. So when "ret" is NULL, it can't be equal to pages[i].
Signed-off-by Zhen Lei <[email protected]>
--- drivers/block/brd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/brd.c +1 -1
@@ -147,7 +147,7 @@ static void brd_free_pages(struct brd_device *brd)BUG_ON (pages[i]->index < pos); pos = pages[i]->index; ret =radix_tree_delete (&brd->brd_pages, pos); -BUG_ON (!ret || ret != pages[i]); +BUG_ON (ret != pages[i]);__free_page (pages[i]); }
Signature · 1 line
2.26.0.106.g9fadedd
Quoted 2 lines · Zhen Lei
Because pages[i] can't be NULL, otherwise "pos = pages[i]->index;" will panic. So when "ret" is NULL, it can't be equal to pages[i].
In fact, "ret != pages[i]" is clear enough.
Quoted 20 lines
Signed-off-by Zhen Lei <[email protected]>--- drivers/block/brd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/block/brd.c +1
-1@@ -147,7 +147,7 @@ static void brd_free_pages(struct brd_device *brd)BUG_ON (pages[i]->index < pos); pos = pages[i]->index; ret =radix_tree_delete (&brd->brd_pages, pos); -BUG_ON (!ret || ret != pages[i]); +BUG_ON (ret != pages[i]);__free_page (pages[i]); }