Re: [PATCH v2] net: ena: Make ena_pci_id_tbl.h self-contained and simplify

From: Arthur Kiyanovski

Date: Tue Nov 03 2026 - 16:53:51 EST


On Tue, 03 Nov 2026 14:22:40 +0100, Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxxx>

Hi Uwe,

Thanks for the respin, the cleanups look good.

The subject is missing the tree tag, so as you suspected this didn't reach
the netdev patchwork or the CI bots. It should be [PATCH net-next v2],
ideally in reply to v1.

On your note about the variable in a header: fair point, but with a single
user I'd leave it as is.

>
>
> 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>
>

These make the dependency explicit for your scan, which makes sense. The
header still isn't self-contained though: it also uses PCI_DEVICE(), which
is defined only in <linux/pci.h> and isn't provided by either of these two
includes.

I don't think pulling in pci.h is worth it here - ena_netdev.c is the only
includer and already has it - so I'd just retitle it to something like
"net: ena: Make ena_pci_id_tbl.h's device-ID dependencies explicit".


If you do want it genuinely self-contained, moving the PCI_DEVICE() and
PCI_VDEVICE() macros into <linux/device-id/pci.h> looks straightforward -
pci.h already includes that header and PCI_ANY_ID is already there. Note
your script won't flag this one, as PCI_DEVICE() never lived in
<linux/mod_devicetable.h>.

net: ena: Make ena_pci_id_tbl.h's device-ID dependencies explicit

net: ena: Make ena_pci_id_tbl.h's device-ID dependencies explicit

--
Arthur Kiyanovski <akiyano@xxxxxxxxxx>