The file ena_pci_id_tbl.h is only included once. Fold it into its only consumer, simplifying a bit en passant. Note that I took out the trailing comma from the expanded value of ENA_PCI_ID_TABLE_ENTRY() and thus these commas have to be added when the macro is used improving readability. Signed-off-by: Uwe Kleine-König --- Hello, I'm currently working on deprecating and my check script stumbled over the header removed here as it used pci_device_id without including a header to get its definition. Instead of adding one, simplify the situation a bit. The change with the trailing comma is maybe subjective, I don't feel strong here and can drop it if desired. Best regards Uwe .../device_drivers/ethernet/amazon/ena.rst | 1 - drivers/net/ethernet/amazon/ena/ena_netdev.c | 18 +++++++- .../net/ethernet/amazon/ena/ena_pci_id_tbl.h | 45 ------------------- 3 files changed, 17 insertions(+), 47 deletions(-) delete mode 100644 drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h diff --git a/Documentation/networking/device_drivers/ethernet/amazon/ena.rst b/Documentation/networking/device_drivers/ethernet/amazon/ena.rst index 14784a0a6a8a..72ea5ebf2f71 100644 --- a/Documentation/networking/device_drivers/ethernet/amazon/ena.rst +++ b/Documentation/networking/device_drivers/ethernet/amazon/ena.rst @@ -55,7 +55,6 @@ ena_regs_defs.h Definition of ENA PCI memory-mapped (MMIO) registers. ena_netdev.[ch] Main Linux kernel driver. ena_ethtool.c ethtool callbacks. ena_xdp.[ch] XDP files -ena_pci_id_tbl.h Supported device IDs. ena_phc.[ch] PTP hardware clock infrastructure (see `PHC`_ for more info) ena_devlink.[ch] devlink files. ena_debugfs.[ch] debugfs files. diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 7eb6456ed0d5..c934d1e922e5 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -16,7 +16,6 @@ #include #include "ena_netdev.h" -#include "ena_pci_id_tbl.h" #include "ena_xdp.h" #include "ena_phc.h" @@ -41,6 +40,23 @@ static struct ena_aenq_handlers aenq_handlers; static struct workqueue_struct *ena_wq; +#define PCI_DEV_ID_ENA_LLQ_PF 0x1ec2 +#define PCI_DEV_ID_ENA_LLQ_VF 0xec21 +#define PCI_DEV_ID_ENA_PF 0x0ec2 +#define PCI_DEV_ID_ENA_VF 0xec20 +#define PCI_DEV_ID_ENA_RESRV0 0x0051 + +#define ENA_PCI_ID_TABLE_ENTRY(devid) \ + { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, devid) } + +static const struct pci_device_id ena_pci_tbl[] = { + ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_RESRV0), + ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_PF), + ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_PF), + ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_VF), + ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_VF), + { } +}; MODULE_DEVICE_TABLE(pci, ena_pci_tbl); static int ena_rss_init_default(struct ena_adapter *adapter); diff --git a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h b/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h deleted file mode 100644 index 3ecdf29160ca..000000000000 --- a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ -/* - * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved. - */ - -#ifndef ENA_PCI_ID_TBL_H_ -#define ENA_PCI_ID_TBL_H_ - -#ifndef PCI_VENDOR_ID_AMAZON -#define PCI_VENDOR_ID_AMAZON 0x1d0f -#endif - -#ifndef PCI_DEV_ID_ENA_PF -#define PCI_DEV_ID_ENA_PF 0x0ec2 -#endif - -#ifndef PCI_DEV_ID_ENA_LLQ_PF -#define PCI_DEV_ID_ENA_LLQ_PF 0x1ec2 -#endif - -#ifndef PCI_DEV_ID_ENA_VF -#define PCI_DEV_ID_ENA_VF 0xec20 -#endif - -#ifndef PCI_DEV_ID_ENA_LLQ_VF -#define PCI_DEV_ID_ENA_LLQ_VF 0xec21 -#endif - -#ifndef PCI_DEV_ID_ENA_RESRV0 -#define PCI_DEV_ID_ENA_RESRV0 0x0051 -#endif - -#define ENA_PCI_ID_TABLE_ENTRY(devid) \ - {PCI_DEVICE(PCI_VENDOR_ID_AMAZON, devid)}, - -static const struct pci_device_id ena_pci_tbl[] = { - ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_RESRV0) - ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_PF) - ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_PF) - ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_VF) - ENA_PCI_ID_TABLE_ENTRY(PCI_DEV_ID_ENA_LLQ_VF) - { } -}; - -#endif /* ENA_PCI_ID_TBL_H_ */ base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 -- 2.56.0.rc1