diff mbox series

[2/3] blk-mq: Clean up blk_mq_requeue_work()

Message ID 20241212212941.1268662-3-bvanassche@acm.org (mailing list archive)
State New
Headers show
Series Three small block layer patches | expand

Commit Message

Bart Van Assche Dec. 12, 2024, 9:29 p.m. UTC
Move a statement that occurs in both branches of an if-statement in front
of the if-statement. Fix a typo in a source code comment. No functionality
has been changed.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-mq.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Christoph Hellwig Dec. 13, 2024, 4:44 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Nitesh Shetty Dec. 13, 2024, 5:34 a.m. UTC | #2
On 12/12/24 01:29PM, Bart Van Assche wrote:
>Move a statement that occurs in both branches of an if-statement in front
>of the if-statement. Fix a typo in a source code comment. No functionality
>has been changed.
>
>Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>Cc: Christoph Hellwig <hch@lst.de>
>Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>---

Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Johannes Thumshirn Dec. 13, 2024, 7:26 a.m. UTC | #3
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index a6ab1757a21a..68dbac660256 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1535,19 +1535,17 @@  static void blk_mq_requeue_work(struct work_struct *work)
 
 	while (!list_empty(&rq_list)) {
 		rq = list_entry(rq_list.next, struct request, queuelist);
+		list_del_init(&rq->queuelist);
 		/*
-		 * If RQF_DONTPREP ist set, the request has been started by the
+		 * If RQF_DONTPREP is set, the request has been started by the
 		 * driver already and might have driver-specific data allocated
 		 * already.  Insert it into the hctx dispatch list to avoid
 		 * block layer merges for the request.
 		 */
-		if (rq->rq_flags & RQF_DONTPREP) {
-			list_del_init(&rq->queuelist);
+		if (rq->rq_flags & RQF_DONTPREP)
 			blk_mq_request_bypass_insert(rq, 0);
-		} else {
-			list_del_init(&rq->queuelist);
+		else
 			blk_mq_insert_request(rq, BLK_MQ_INSERT_AT_HEAD);
-		}
 	}
 
 	while (!list_empty(&flush_list)) {