nvme-pci: Move enumeration by class to be last in the table
PATCH v2 1/1 nvme-pci: Move enumeration by class to be last in the table
It's unusual that we have enumeration by class in the middle of the table. It might potentially be problematic in the future if we add another entry after it.
So, move class matching entry to be the last in the ID table.
---
v2: appended tags and rebased on top of v5.9-rc1
drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), .driver_data = NVME_QUIRK_SINGLE_VECTOR }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
@@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_SINGLE_VECTOR | NVME_QUIRK_128_BYTES_SQES | NVME_QUIRK_SHARED_TAGS }, + + { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { 0, } };MODULE_DEVICE_TABLE (pci, nvme_id_table);
Signature · 7 lines
2.28.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 5 lines · Andy Shevchenko
It's unusual that we have enumeration by class in the middle of the table. It might potentially be problematic in the future if we add another entry after it.
So, move class matching entry to be the last in the ID table.
Is it good enough?
Quoted 34 lines
Cc Benjamin Herrenschmidt <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Chaitanya Kulkarni <[email protected]>Reviewed-by Christoph Hellwig <[email protected]>Reviewed-by Sagi Grimberg <[email protected]>---
v2: appended tags and rebased on top of v5.9-rc1drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/pci.c +2
-1@@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), .driver_data = NVME_QUIRK_SINGLE_VECTOR }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },@@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_SINGLE_VECTOR | NVME_QUIRK_128_BYTES_SQES | NVME_QUIRK_SHARED_TAGS }, + + { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { 0, } };MODULE_DEVICE_TABLE (pci, nvme_id_table);Signature · 1 line
2.28.0
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 5 lines · Andy Shevchenko
It's unusual that we have enumeration by class in the middle of the table. It might potentially be problematic in the future if we add another entry after it.
So, move class matching entry to be the last in the ID table.
Everything below it uses a different class code, so the separation by class sort of makes sense. But I agree it looks error prone if anyone wants to append to it, so the change is okay with me.
Quoted 34 lines
Cc Benjamin Herrenschmidt <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Chaitanya Kulkarni <[email protected]>Reviewed-by Christoph Hellwig <[email protected]>Reviewed-by Sagi Grimberg <[email protected]>---
v2: appended tags and rebased on top of v5.9-rc1drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/pci.c +2
-1@@ -3185,7 +3185,6 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), .driver_data = NVME_QUIRK_SINGLE_VECTOR }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },@@ -3193,6 +3192,8 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_SINGLE_VECTOR | NVME_QUIRK_128_BYTES_SQES | NVME_QUIRK_SHARED_TAGS }, + + { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { 0, } };MODULE_DEVICE_TABLE (pci, nvme_id_table);Signature · 1 line
2.28.0
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 8 lines · Andy Shevchenko
Quoted 5 lines · Andy Shevchenko
It's unusual that we have enumeration by class in the middle of the table. It might potentially be problematic in the future if we add another entry after it.
So, move class matching entry to be the last in the ID table.
Is it good enough?
Yes. This is in my for-5.10 queue, which just hasn't been pushed out yet.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme