The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] block: optimize sq_hctx assignment
@ 2025-03-28  3:13 Fanhui Meng
  2025-03-28 10:55 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Fanhui Meng @ 2025-03-28  3:13 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, mengfanhui

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(-)

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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: optimize sq_hctx assignment
  2025-03-28  3:13 [PATCH] block: optimize sq_hctx assignment Fanhui Meng
@ 2025-03-28 10:55 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2025-03-28 10:55 UTC (permalink / raw)
  To: Fanhui Meng; +Cc: axboe, linux-block, linux-kernel

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-28 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28  3:13 [PATCH] block: optimize sq_hctx assignment Fanhui Meng
2025-03-28 10:55 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox