Skip to content

Commit b4e12f5

Browse files
Chunguang.xukeithbusch
authored andcommitted
nvme-tcp: simplify nvme_tcp_teardown_io_queues()
As nvme_tcp_teardown_io_queues() is the only one caller of nvme_tcp_destroy_admin_queue(), so we can merge it into nvme_tcp_teardown_io_queues() to simplify the code. Signed-off-by: Chunguang.xu <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent fdc5664 commit b4e12f5

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/nvme/host/tcp.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,14 +2101,6 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
21012101
return ret;
21022102
}
21032103

2104-
static void nvme_tcp_destroy_admin_queue(struct nvme_ctrl *ctrl, bool remove)
2105-
{
2106-
nvme_tcp_stop_queue(ctrl, 0);
2107-
if (remove)
2108-
nvme_remove_admin_tag_set(ctrl);
2109-
nvme_tcp_free_admin_queue(ctrl);
2110-
}
2111-
21122104
static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new)
21132105
{
21142106
int error;
@@ -2163,9 +2155,11 @@ static void nvme_tcp_teardown_admin_queue(struct nvme_ctrl *ctrl,
21632155
blk_sync_queue(ctrl->admin_q);
21642156
nvme_tcp_stop_queue(ctrl, 0);
21652157
nvme_cancel_admin_tagset(ctrl);
2166-
if (remove)
2158+
if (remove) {
21672159
nvme_unquiesce_admin_queue(ctrl);
2168-
nvme_tcp_destroy_admin_queue(ctrl, remove);
2160+
nvme_remove_admin_tag_set(ctrl);
2161+
}
2162+
nvme_tcp_free_admin_queue(ctrl);
21692163
if (ctrl->tls_pskid) {
21702164
dev_dbg(ctrl->device, "Wipe negotiated TLS_PSK %08x\n",
21712165
ctrl->tls_pskid);

0 commit comments

Comments
 (0)