All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"kch@nvidia.com" <kch@nvidia.com>
Subject: Re: [PATCH 2/2] blk-mq: simplify blk_mq_realloc_tag_set_tags
Date: Mon, 21 Nov 2022 08:58:57 +0100	[thread overview]
Message-ID: <20221121075857.GA24878@lst.de> (raw)
In-Reply-To: <20221118140640.featvt3fxktfquwh@shindev>

The fix looks good, but could be simplified a bit more:

diff --git a/block/blk-mq.c b/block/blk-mq.c
index ee16b4c34c6a5..cdd8efcec1916 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4381,7 +4381,7 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 	struct blk_mq_tags **new_tags;
 
 	if (set->nr_hw_queues >= new_nr_hw_queues)
-		return 0;
+		goto done;
 
 	new_tags = kcalloc_node(new_nr_hw_queues, sizeof(struct blk_mq_tags *),
 				GFP_KERNEL, set->numa_node);
@@ -4393,8 +4393,8 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 		       sizeof(*set->tags));
 	kfree(set->tags);
 	set->tags = new_tags;
+done:
 	set->nr_hw_queues = new_nr_hw_queues;
-
 	return 0;
 }
 

  reply	other threads:[~2022-11-21  7:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 10:08 [PATCH 1/2] blk-mq: remove blk_mq_alloc_tag_set_tags Christoph Hellwig
2022-11-09 10:08 ` [PATCH 2/2] blk-mq: simplify blk_mq_realloc_tag_set_tags Christoph Hellwig
2022-11-09 19:45   ` Chaitanya Kulkarni
2022-11-18 14:06   ` Shinichiro Kawasaki
2022-11-21  7:58     ` Christoph Hellwig [this message]
2022-11-21 11:14       ` Shinichiro Kawasaki
2022-11-21 13:19         ` Christoph Hellwig
2022-11-22  6:54           ` Shinichiro Kawasaki
2022-11-09 19:45 ` [PATCH 1/2] blk-mq: remove blk_mq_alloc_tag_set_tags Chaitanya Kulkarni
2022-11-10 18:18 ` Jens Axboe

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=20221121075857.GA24878@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.