diff mbox series

block: optimize sq_hctx assignment

Message ID 20250328031321.790317-1-mengfanhui@kylinos.cn (mailing list archive)
State New
Headers show
Series block: optimize sq_hctx assignment | expand

Commit Message

Fanhui Meng March 28, 2025, 3:13 a.m. UTC
Optimizing code for greater standardization.

Signed-off-by: Fanhui Meng <mengfanhui@kylinos.cn>
---
 block/blk-mq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Christoph Hellwig March 28, 2025, 10:55 a.m. UTC | #1
On Fri, Mar 28, 2025 at 11:13:21AM +0800, Fanhui Meng wrote:
> Optimizing code for greater standardization.

not sure what is an optimization here.  I personally really like
initializing variables at declaration time, but it's not an optimization
and without other changes it the area this really just feels like churn.
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 40490ac88045..182557019832 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2384,10 +2384,9 @@  static struct blk_mq_hw_ctx *blk_mq_get_sq_hctx(struct request_queue *q)
  */
 void blk_mq_run_hw_queues(struct request_queue *q, bool async)
 {
-	struct blk_mq_hw_ctx *hctx, *sq_hctx;
+	struct blk_mq_hw_ctx *hctx, *sq_hctx = NULL;
 	unsigned long i;
 
-	sq_hctx = NULL;
 	if (blk_queue_sq_sched(q))
 		sq_hctx = blk_mq_get_sq_hctx(q);
 	queue_for_each_hw_ctx(q, hctx, i) {