]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nvme: don't pass cap to nvme_disable_ctrl
authorSagi Grimberg <sagi@grimberg.me>
Tue, 23 Jul 2019 00:06:54 +0000 (17:06 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Thu, 29 Aug 2019 19:55:00 +0000 (12:55 -0700)
All seem to call it with ctrl->cap so no need to pass it
at all.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c
drivers/nvme/host/rdma.c
drivers/nvme/host/tcp.c

index 9e832694f9d0eb28ae7206d5ab1056fa7921fc14..35311d343a133fa351d257bcb20f0edaee1ac5d3 100644 (file)
@@ -1950,7 +1950,7 @@ static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled)
  * bits', but doing so may cause the device to complete commands to the
  * admin queue ... and we don't know what memory that might be pointing at!
  */
-int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap)
+int nvme_disable_ctrl(struct nvme_ctrl *ctrl)
 {
        int ret;
 
@@ -1964,7 +1964,7 @@ int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap)
        if (ctrl->quirks & NVME_QUIRK_DELAY_BEFORE_CHK_RDY)
                msleep(NVME_QUIRK_DELAY_AMOUNT);
 
-       return nvme_wait_ready(ctrl, cap, false);
+       return nvme_wait_ready(ctrl, ctrl->cap, false);
 }
 EXPORT_SYMBOL_GPL(nvme_disable_ctrl);
 
index 26540feed511c553308a05439c72c1880e27ed9f..7c86e4bcd2712d0656aa128f2c6d6f64718d5ae6 100644 (file)
@@ -426,7 +426,7 @@ void nvme_complete_rq(struct request *req);
 bool nvme_cancel_request(struct request *req, void *data, bool reserved);
 bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
                enum nvme_ctrl_state new_state);
-int nvme_disable_ctrl(struct nvme_ctrl *ctrl, u64 cap);
+int nvme_disable_ctrl(struct nvme_ctrl *ctrl);
 int nvme_enable_ctrl(struct nvme_ctrl *ctrl);
 int nvme_shutdown_ctrl(struct nvme_ctrl *ctrl);
 int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
index cc5787e5b4519d1dd41948c3f228fffad7b6c36e..bf54b128c5a46f153d431fc77e8e265475b87708 100644 (file)
@@ -1403,7 +1403,7 @@ static void nvme_disable_admin_queue(struct nvme_dev *dev, bool shutdown)
        if (shutdown)
                nvme_shutdown_ctrl(&dev->ctrl);
        else
-               nvme_disable_ctrl(&dev->ctrl, dev->ctrl.cap);
+               nvme_disable_ctrl(&dev->ctrl);
 
        nvme_poll_irqdisable(nvmeq, -1);
 }
@@ -1679,7 +1679,7 @@ static int nvme_pci_configure_admin_queue(struct nvme_dev *dev)
            (readl(dev->bar + NVME_REG_CSTS) & NVME_CSTS_NSSRO))
                writel(NVME_CSTS_NSSRO, dev->bar + NVME_REG_CSTS);
 
-       result = nvme_disable_ctrl(&dev->ctrl, dev->ctrl.cap);
+       result = nvme_disable_ctrl(&dev->ctrl);
        if (result < 0)
                return result;
 
index 09ab05c458a877646f8e154f0a095cb2b59193de..10e3bcdb71808fe2406b65f13bf1b78d6b83a859 100644 (file)
@@ -1859,7 +1859,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown)
        if (shutdown)
                nvme_shutdown_ctrl(&ctrl->ctrl);
        else
-               nvme_disable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap);
+               nvme_disable_ctrl(&ctrl->ctrl);
        nvme_rdma_teardown_admin_queue(ctrl, shutdown);
 }
 
index 088dac0d97c46129e454b66d0379686a17940f10..0317721fe8586cbb6afd264827c04067e98e23a4 100644 (file)
@@ -1886,7 +1886,7 @@ static void nvme_tcp_teardown_ctrl(struct nvme_ctrl *ctrl, bool shutdown)
        if (shutdown)
                nvme_shutdown_ctrl(ctrl);
        else
-               nvme_disable_ctrl(ctrl, ctrl->cap);
+               nvme_disable_ctrl(ctrl);
        nvme_tcp_teardown_admin_queue(ctrl, shutdown);
 }