diff mbox series

[RESEND,v2,07/10] block, bfq: remove redundant check in bfq_put_cooperator

Message ID 20221222191641.1643117-8-shikemeng@huaweicloud.com (mailing list archive)
State New, archived
Headers show
Series A few bugfix and cleancode patch for bfq | expand

Commit Message

Kemeng Shi Dec. 22, 2022, 7:16 p.m. UTC
We have already avoided a circular list in bfq_setup_merge (see comments
in bfq_setup_merge() for details), so bfq_queue will not appear in it's
new_bfqq list. Just remove this check.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 block/bfq-iosched.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jan Kara Jan. 2, 2023, 3:57 p.m. UTC | #1
On Fri 23-12-22 03:16:38, Kemeng Shi wrote:
> We have already avoided a circular list in bfq_setup_merge (see comments
> in bfq_setup_merge() for details), so bfq_queue will not appear in it's
> new_bfqq list. Just remove this check.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  block/bfq-iosched.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 7c91d16dbf6f..89995815dbae 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -5273,8 +5273,6 @@ void bfq_put_cooperator(struct bfq_queue *bfqq)
>  	 */
>  	__bfqq = bfqq->new_bfqq;
>  	while (__bfqq) {
> -		if (__bfqq == bfqq)
> -			break;
>  		next = __bfqq->new_bfqq;
>  		bfq_put_queue(__bfqq);
>  		__bfqq = next;
> -- 
> 2.30.0
>
diff mbox series

Patch

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 7c91d16dbf6f..89995815dbae 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -5273,8 +5273,6 @@  void bfq_put_cooperator(struct bfq_queue *bfqq)
 	 */
 	__bfqq = bfqq->new_bfqq;
 	while (__bfqq) {
-		if (__bfqq == bfqq)
-			break;
 		next = __bfqq->new_bfqq;
 		bfq_put_queue(__bfqq);
 		__bfqq = next;