[PATCH v2] nvme-pci: Move enumeration by class to be last in the table

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Sep 14 11:33:22 EDT 2020


On Tue, Aug 18, 2020 at 11:35:30AM +0300, Andy Shevchenko wrote:
> 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?

> Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> v2: appended tags and rebased on top of v5.9-rc1
>  drivers/nvme/host/pci.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index ba725ae47305..95ea671e5c9e 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -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);
> -- 
> 2.28.0
> 

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-nvme mailing list