diff mbox series

[16/17] block, bfq: remove unnecessary goto tag in __bfq_weights_tree_remove

Message ID 20230219104309.1511562-17-shikemeng@huaweicloud.com (mailing list archive)
State New, archived
Headers show
Series Some bugfix and cleanup patches for bfq | expand

Commit Message

Kemeng Shi Feb. 19, 2023, 10:43 a.m. UTC
Do free work if num_active == 0 and remove unnecessary tag
reset_entity_pointer.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 block/bfq-iosched.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 6ba096e9aec6..2705a24ab146 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -976,13 +976,11 @@  void bfq_weights_tree_remove(struct bfq_queue *bfqq)
 
 	root = &bfqq->bfqd->queue_weights_tree;
 	bfqq->weight_counter->num_active--;
-	if (bfqq->weight_counter->num_active > 0)
-		goto reset_entity_pointer;
-
-	rb_erase_cached(&bfqq->weight_counter->weights_node, root);
-	kfree(bfqq->weight_counter);
+	if (bfqq->weight_counter->num_active == 0) {
+		rb_erase_cached(&bfqq->weight_counter->weights_node, root);
+		kfree(bfqq->weight_counter);
+	}
 
-reset_entity_pointer:
 	bfqq->weight_counter = NULL;
 	bfq_put_queue(bfqq);
 }