mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liu Song <liusong@linux.alibaba.com>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] blk-mq: remove unnecessary variables in blk_mq_init_cpu_queues
Date: Fri, 24 Jun 2022 11:30:24 +0800	[thread overview]
Message-ID: <1656041424-50894-1-git-send-email-liusong@linux.alibaba.com> (raw)

From: Liu Song <liusong@linux.alibaba.com>

Remove unnecessary variables and adjust code style to be the same as
other functions in blk-mq.c, no functional modification involved.

Signed-off-by: Liu Song <liusong@linux.alibaba.com>
---
 block/blk-mq.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index e9bf950..c71119d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3579,19 +3579,18 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
 				   unsigned int nr_hw_queues)
 {
 	struct blk_mq_tag_set *set = q->tag_set;
+	struct blk_mq_ctx *ctx;
+	struct blk_mq_hw_ctx *hctx;
 	unsigned int i, j;
 
 	for_each_possible_cpu(i) {
-		struct blk_mq_ctx *__ctx = per_cpu_ptr(q->queue_ctx, i);
-		struct blk_mq_hw_ctx *hctx;
-		int k;
-
-		__ctx->cpu = i;
-		spin_lock_init(&__ctx->lock);
-		for (k = HCTX_TYPE_DEFAULT; k < HCTX_MAX_TYPES; k++)
-			INIT_LIST_HEAD(&__ctx->rq_lists[k]);
+		ctx = per_cpu_ptr(q->queue_ctx, i);
+		ctx->cpu = i;
+		ctx->queue = q;
 
-		__ctx->queue = q;
+		spin_lock_init(&ctx->lock);
+		for (j = HCTX_TYPE_DEFAULT; j < HCTX_MAX_TYPES; j++)
+			INIT_LIST_HEAD(&ctx->rq_lists[j]);
 
 		/*
 		 * Set local node, IFF we have more than one hw queue. If
-- 
1.8.3.1


                 reply	other threads:[~2022-06-24  3:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1656041424-50894-1-git-send-email-liusong@linux.alibaba.com \
    --to=liusong@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®