diff mbox series

[1/4] nvme-pci: Set tagset nr_maps just once

Message ID 20190103210954.11129-1-keith.busch@intel.com
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series [1/4] nvme-pci: Set tagset nr_maps just once | expand

Commit Message

Keith Busch Jan. 3, 2019, 9:09 p.m. UTC
The driver overwrites the intermediate nr_map assignments to
HCTX_MAX_TYPES, so remove those unnecessary temporary settings.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/nvme/host/pci.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Christoph Hellwig Jan. 4, 2019, 6:15 p.m. UTC | #1
On Thu, Jan 03, 2019 at 02:09:51PM -0700, Keith Busch wrote:
> The driver overwrites the intermediate nr_map assignments to
> HCTX_MAX_TYPES, so remove those unnecessary temporary settings.
> 
> Signed-off-by: Keith Busch <keith.busch@intel.com>

Actually the more complex calculation is the right one here.
I've just merged a patch from Jianchao to remove the other line.
Keith Busch Jan. 4, 2019, 6:19 p.m. UTC | #2
On Fri, Jan 04, 2019 at 07:15:28PM +0100, Christoph Hellwig wrote:
> On Thu, Jan 03, 2019 at 02:09:51PM -0700, Keith Busch wrote:
> > The driver overwrites the intermediate nr_map assignments to
> > HCTX_MAX_TYPES, so remove those unnecessary temporary settings.
> > 
> > Signed-off-by: Keith Busch <keith.busch@intel.com>
> 
> Actually the more complex calculation is the right one here.
> I've just merged a patch from Jianchao to remove the other line.

Yep, I just saw that. Jianchao's is the right way to go here.
diff mbox series

Patch

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5a0bf6a24d50..98332d0a80f0 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2291,9 +2291,6 @@  static int nvme_dev_add(struct nvme_dev *dev)
 	if (!dev->ctrl.tagset) {
 		dev->tagset.ops = &nvme_mq_ops;
 		dev->tagset.nr_hw_queues = dev->online_queues - 1;
-		dev->tagset.nr_maps = 2; /* default + read */
-		if (dev->io_queues[HCTX_TYPE_POLL])
-			dev->tagset.nr_maps++;
 		dev->tagset.nr_maps = HCTX_MAX_TYPES;
 		dev->tagset.timeout = NVME_IO_TIMEOUT;
 		dev->tagset.numa_node = dev_to_node(dev->dev);