RE: [Intel-wired-lan] [PATCH net-next] net: Consistently define pci_device_ids using named initializers

From: Loktionov, Aleksandr

Date: Wed Apr 29 2026 - 05:24:35 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Uwe Kleine-König (The Capable Hub)
> Sent: Tuesday, April 28, 2026 7:19 PM
> To: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>; Andrew Lunn
> <andrew+netdev@xxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric
> Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo
> Abeni <pabeni@xxxxxxxxxx>; Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>;
> Vincent Mailhol <mailhol@xxxxxxxxxx>; Krzysztof Halasa
> <khc@xxxxxxxxx>; Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
> Cc: Richard Cochran <richardcochran@xxxxxxxxx>; Yonglong Liu
> <liuyonglong@xxxxxxxxxx>; Kees Cook <kees@xxxxxxxxxx>; linux-
> wireless@xxxxxxxxxxxxxxx; Zaremba, Larysa <larysa.zaremba@xxxxxxxxx>;
> brcm80211@xxxxxxxxxxxxxxx; Daniele Venzano <venza@xxxxxxxxxxxx>; oss-
> drivers@xxxxxxxxxxxx; Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>;
> MD Danish Anwar <danishanwar@xxxxxx>; Samuel Chessman
> <chessman@xxxxxxx>; Fan Gong <gongfan1@xxxxxxxxxx>; Marco Crivellari
> <marco.crivellari@xxxxxxxx>; Kevin Curtis
> <kevin.curtis@xxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Ion
> Badulescu <ionut@xxxxxxxxxx>; Shevchenko, Andriy
> <andriy.shevchenko@xxxxxxxxx>; Leon Romanovsky <leon@xxxxxxxxxx>;
> Colin Ian King <colin.i.king@xxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Peiyang Wang
> <wangpeiyang1@xxxxxxxxxx>; Thomas Fourier <fourier.thomas@xxxxxxxxx>;
> Sai Krishna <saikrishnag@xxxxxxxxxxx>; Denis Kirjanov
> <kirjanov@xxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx; linux-
> parisc@xxxxxxxxxxxxxxx; Keller, Jacob E <jacob.e.keller@xxxxxxxxx>;
> Mengyuan Lou <mengyuanlou@xxxxxxxxxxxxx>; Steffen Klassert
> <klassert@xxxxxxxxxx>; Stanislav Yakovlev <stas.yakovlev@xxxxxxxxx>;
> linux-rdma@xxxxxxxxxxxxxxx; Arend van Spriel
> <arend.vanspriel@xxxxxxxxxxxx>; nic_swsd@xxxxxxxxxxx; Jiri Pirko
> <jiri@xxxxxxxxxxx>; Philipp Stanner <phasta@xxxxxxxxxx>; Chi-hsien Lin
> <chi-hsien.lin@xxxxxxxxxxx>; Ido Schimmel <idosch@xxxxxxxxxx>; Potnuri
> Bharat Teja <bharat@xxxxxxxxxxx>; Double Lo <double.lo@xxxxxxxxxxx>;
> Markus Schneider-Pargmann <msp@xxxxxxxxxxxx>; Nathan Chancellor
> <nathan@xxxxxxxxxx>; Jiawen Wu <jiawenwu@xxxxxxxxxxxxxx>; Cai Huoqing
> <cai.huoqing@xxxxxxxxx>; Bjorn Helgaas <bhelgaas@xxxxxxxxxx>; Zilin
> Guan <zilin@xxxxxxxxxx>; linux-can@xxxxxxxxxxxxxxx; Yibo Dong
> <dong100@xxxxxxxxx>; Joe Damato <joe@xxxxxxx>; Petr Machata
> <petrm@xxxxxxxxxx>; Kory Maincent <kory.maincent@xxxxxxxxxxx>;
> brcm80211-dev-list.pdl@xxxxxxxxxxxx; GR-Linux-NIC-Dev@xxxxxxxxxxx;
> Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>; Manish Chopra
> <manishc@xxxxxxxxxxx>; Denis Benato <benato.denis96@xxxxxxxxx>; Rasesh
> Mody <rmody@xxxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; Randy Dunlap
> <rdunlap@xxxxxxxxxxxxx>; Mark Bloch <mbloch@xxxxxxxxxx>; linux-
> kernel@xxxxxxxxxxxxxxx; Tariq Toukan <tariqt@xxxxxxxxxx>; Jian Shen
> <shenjian15@xxxxxxxxxx>; Jijie Shao <shaojijie@xxxxxxxxxx>; Yeounsu
> Moon <yyyynoom@xxxxxxxxx>; Thomas Gleixner <tglx@xxxxxxxxxx>; Simon
> Horman <horms@xxxxxxxxxx>; Yicong Hui <yiconghui@xxxxxxxxx>; Mark
> Einon <mark.einon@xxxxxxxxx>; Ethan Nelson-Moore
> <enelsonmoore@xxxxxxxxx>; Saeed Mahameed <saeedm@xxxxxxxxxx>;
> Sudarsana Kalluru <skalluru@xxxxxxxxxxx>; Heiner Kallweit
> <hkallweit1@xxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH net-next] net: Consistently define
> pci_device_ids using named initializers
>
> ... and PCI device helpers.
>
> The various struct pci_device_id arrays were initialized mostly by one
> the PCI_DEVICE macros and then list expressions. The latter isn't
> easily
> readable if you're not into PCI. Using named initializers is more
> explicit and thus easier to parse.
>
> Also use PCI_DEVICE* helper macros to assign .vendor, .device,
> .subvendor and .subdevice where appropriate and skip explicit
> assignments of 0 (which the compiler takes care of).
>
> The secret plan is to make struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-
> koenig@xxxxxxxxxxxx/)
> and that requires named initializers. But it's also a nice cleanup on
> its own.
>
> This change doesn't introduce changes to the compiled pci_device_id
> arrays. Tested on x86 and arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-
> koenig@xxxxxxxxxxxx>
> ---
> Hello,
>
> the mentioned follow-up quest allows to do
>
> PCI_DEVICE(0x1571, 0xa203),
> + .driver_data = (kernel_ulong_t)&card_info_10mbit,
> - .driver_data_ptr = &card_info_10mbit,
>
> which gets rid of a bunch of casts and so brings a little bit more
> type
> safety. This patch is a preparation for that.
>
> I handled all of drivers/net/ in a single patch, please tell me if I
> should split by subsystem.
>
> Best regards
> Uwe
> ---
> drivers/net/arcnet/com20020-pci.c | 242 +++------
> drivers/net/can/m_can/m_can_pci.c | 6 +-
> drivers/net/can/sja1000/plx_pci.c | 167 +++----
> drivers/net/ethernet/3com/3c59x.c | 80 +--
> drivers/net/ethernet/3com/typhoon.c | 75 ++-
> drivers/net/ethernet/8390/ne2k-pci.c | 24 +-
> drivers/net/ethernet/adaptec/starfire.c | 4 +-
> drivers/net/ethernet/agere/et131x.c | 6 +-
> drivers/net/ethernet/broadcom/bnx2.c | 62 ++-
> .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 50 +-
> .../net/ethernet/cavium/liquidio/lio_main.c | 10 +-
> .../ethernet/cavium/liquidio/lio_vf_main.c | 7 +-
> drivers/net/ethernet/chelsio/cxgb/common.h | 2 +-
> drivers/net/ethernet/chelsio/cxgb/subr.c | 2 +-
> .../net/ethernet/chelsio/cxgb3/cxgb3_main.c | 4 +-
> .../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 4 +-
> .../ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 4 +-
> drivers/net/ethernet/dec/tulip/de2104x.c | 6 +-
> drivers/net/ethernet/dec/tulip/dmfe.c | 12 +-
> drivers/net/ethernet/dec/tulip/tulip_core.c | 78 +--
> drivers/net/ethernet/dec/tulip/uli526x.c | 6 +-
> drivers/net/ethernet/dec/tulip/winbond-840.c | 13 +-
> drivers/net/ethernet/dlink/dl2k.h | 12 +-
> drivers/net/ethernet/dlink/sundance.c | 14 +-
> drivers/net/ethernet/fealnx.c | 8 +-
> .../net/ethernet/hisilicon/hibmcge/hbg_main.c | 2 +-
> .../net/ethernet/hisilicon/hns3/hns3_enet.c | 50 +-
> .../hisilicon/hns3/hns3pf/hclge_main.c | 18 +-
> .../hisilicon/hns3/hns3vf/hclgevf_main.c | 12 +-
> .../net/ethernet/huawei/hinic/hinic_main.c | 12 +-
> .../net/ethernet/huawei/hinic3/hinic3_lld.c | 7 +-
> drivers/net/ethernet/intel/e100.c | 4 +-
> drivers/net/ethernet/intel/e1000e/netdev.c | 471 +++++++++++++----
> -
> drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 10 +-
> drivers/net/ethernet/intel/i40e/i40e_main.c | 59 +--
> drivers/net/ethernet/intel/iavf/iavf_main.c | 10 +-
> drivers/net/ethernet/intel/igb/igb_main.c | 66 +--
> drivers/net/ethernet/intel/igbvf/netdev.c | 4 +-
> drivers/net/ethernet/intel/igc/igc_main.c | 34 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 106 ++--
> .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 49 +-
> drivers/net/ethernet/mellanox/mlx4/main.c | 6 +-
> .../net/ethernet/mellanox/mlx5/core/main.c | 26 +-
> .../net/ethernet/mellanox/mlxsw/spectrum.c | 16 +-
> drivers/net/ethernet/micrel/ksz884x.c | 8 +-
> .../net/ethernet/mucse/rnpgbe/rnpgbe_main.c | 10 +-
> drivers/net/ethernet/natsemi/natsemi.c | 4 +-
> drivers/net/ethernet/netronome/nfp/nfp_main.c | 81 +--
> .../ethernet/netronome/nfp/nfp_netvf_main.c | 41 +-
> drivers/net/ethernet/qlogic/qede/qede_main.c | 20 +-
> drivers/net/ethernet/realtek/8139too.c | 52 +-
> drivers/net/ethernet/realtek/r8169_main.c | 8 +-
> drivers/net/ethernet/rocker/rocker_main.c | 4 +-
> drivers/net/ethernet/sis/sis190.c | 6 +-
> drivers/net/ethernet/sis/sis900.c | 10 +-
> drivers/net/ethernet/smsc/epic100.c | 18 +-
> drivers/net/ethernet/sun/cassini.c | 8 +-
> drivers/net/ethernet/sun/sungem.c | 26 +-
> drivers/net/ethernet/ti/tlan.c | 41 +-
> drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 26 +-
> .../net/ethernet/wangxun/ngbevf/ngbevf_main.c | 26 +-
> .../net/ethernet/wangxun/txgbe/txgbe_main.c | 18 +-
> .../ethernet/wangxun/txgbevf/txgbevf_main.c | 18 +-
> drivers/net/wan/farsync.c | 24 +-
> drivers/net/wan/pc300too.c | 14 +-
> drivers/net/wan/pci200syn.c | 6 +-
> drivers/net/wan/wanxl.c | 11 +-
> .../broadcom/brcm80211/brcmfmac/pcie.c | 17 +-
> drivers/net/wireless/intel/ipw2x00/ipw2200.c | 52 +-
> 69 files changed, 1308 insertions(+), 1101 deletions(-)
>
> diff --git a/drivers/net/arcnet/com20020-pci.c
> b/drivers/net/arcnet/com20020-pci.c
> index dbadda08dce2..6474c7be2992 100644
> --- a/drivers/net/arcnet/com20020-pci.c
> +++ b/drivers/net/arcnet/com20020-pci.c
> @@ -459,168 +459,88 @@ static struct com20020_pci_card_info
> card_info_eae_fb2 = {
>
> static const struct pci_device_id com20020pci_id_table[] = {
> {

...

> };
>
> MODULE_DEVICE_TABLE(pci, card_ids);
>
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
> --
> 2.47.3


Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>