From 476cdab0a9e09299bd2f95211f0451eb0470da30 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Wed, 25 Feb 2026 06:58:55 +0900 Subject: [PATCH] block: simplify blk_mq_finish_request() Remove the local q variable as it is not necessary. This also removes a useless pointer dereference when RQF_USE_SCHED is not set for a request. Signed-off-by: Damien Le Moal --- block/blk-mq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 3da2215b2912..3a1645f18fa7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -781,12 +781,10 @@ EXPORT_SYMBOL_GPL(blk_mq_alloc_request_hctx); static void blk_mq_finish_request(struct request *rq) { - struct request_queue *q = rq->q; - blk_zone_finish_request(rq); if (rq->rq_flags & RQF_USE_SCHED) { - q->elevator->type->ops.finish_request(rq); + rq->q->elevator->type->ops.finish_request(rq); /* * For postflush request that may need to be * completed twice, we should clear this flag