Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Uwe Kleine-König
Tue, 03 Nov 2026 13:22
[PATCH v2] net: ena: Make ena_pci_id_tbl.h self-contained and simplify
Author: Uwe Kleine-König
Date: Tue, 03 Nov 2026 13:22
Date: Tue, 03 Nov 2026 13:22
92 lines
14845 bytes
14845 bytes
The header makes use of struct pci_device_id and PCI_VENDOR_ID_AMAZON.
Include the needed header for those and drop the local definition of the
latter.
While touching this file drop some cpp guards and improve the coding
style.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,
(implicit) v1 of this patch had a different subject, so maybe teh
automatisms won't find it for automatic comparison, but you can find it
at
https://lore.kernel.org/netdev/20261102110907.356621-2-u.kleine-koenig@baylibre.com
. Changes since then:
- keep the local header and make it self-contained
- Do the simplifictions in the header instead of the folded-in copy
Note that while keeping the header is fine for me in principle, I still
consider it a bit ugly to have a variable defined in a header. OK, there
is only a single user, but if there were two or more, each user would
get its own copy of that variable. 🤷
Still this patch makes my mod_deviceid.h check script happy because now
the usage of pci_device_id doesn't depend on ena_netdev.c including
<linux/device-id/pci.h> before ena_pci_id_tbl.h.
Best regards
Uwe
.../net/ethernet/amazon/ena/ena_pci_id_tbl.h | 31 +++++--------------
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h b/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
index 3ecdf29160ca..72605991528c 100644
--- a/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
+++ b/drivers/net/ethernet/amazon/ena/ena_pci_id_tbl.h
@@ -6,39 +6,24 @@
#ifndef ENA_PCI_ID_TBL_H_
#define ENA_PCI_ID_TBL_H_
-#ifndef PCI_VENDOR_ID_AMAZON
-#define PCI_VENDOR_ID_AMAZON 0x1d0f
-#endif
+#include <linux/device-id/pci.h>
+#include <linux/pci_ids.h>
-#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)},
+ { 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)
+ 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),
{ }
};
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.56.0.rc1
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads