# RE: \[PATCH net-next v2 2/2\] net: nfp: Drop PCI class entries with .class\_mask = 0

- From: Loktionov, Aleksandr \<hidden\>
- Date: 2026-05-07 11:12:07 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/05/6364776
- Thread: https://ratatoskr.run/netdev/2026/05/6364734/t.md

```text


> -----Original Message-----
> From: Uwe Kleine-König (The Capable Hub) <u.kleine-
> koenig@baylibre.com>
> Sent: Thursday, May 7, 2026 12:50 PM
> To: Andrew Lunn <andrew+netdev@lunn.ch>; David S. Miller
> [ref]; Eric Dumazet [ref]; Paolo Abeni
> [ref]
> Cc: Loktionov, Aleksandr <redacted>; Petr Machata
> [ref]; Johannes Berg [ref]; Arend
> van Spriel [ref]; Marco Crivellari
> [ref]; Kees Cook [ref]; Jakub
> Kicinski [ref]; Simon Horman [ref]; oss-
> drivers@corigine.com; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Markus Schneider-Pargmann [ref]
> Subject: [PATCH net-next v2 2/2] net: nfp: Drop PCI class entries with
> .class_mask = 0
> 
> With .class_mask being zero the value of .class doesn't matter because
> to check if a pci_device_id entry matches a given device the
> expression
> 
> 	(id->class ^ dev->class) & id->class_mask
> 
> is checked for being zero (see pci_match_one_device()). So drop the
> useless assignment for .class and .class_mask to match what (I think)
> all other drivers are doing.
> 
> This also resolves an ambiguity because PCI_VDEVICE_SUB() already
> contains values for .class and .class_mask (which gcc ignores in the
> presence of the named initializer).
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-
> koenig@baylibre.com>
> ---
>  drivers/net/ethernet/netronome/nfp/nfp_main.c    | 16 ---------------
> -
>  .../net/ethernet/netronome/nfp/nfp_netvf_main.c  |  8 --------
>  2 files changed, 24 deletions(-)
> 
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c
> b/drivers/net/ethernet/netronome/nfp/nfp_main.c
> index e8e4b84d505a..5a9fb5bad405 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
> @@ -36,50 +36,34 @@ static const struct pci_device_id
> nfp_pci_device_ids[] = {
>  	{
>  		PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP3800,
>  				PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),

...

>  		.driver_data = NFP_DEV_NFP6000_VF,
>  	},
>  	{ } /* Required last entry. */
> --
> 2.47.3


Reviewed-by: Aleksandr Loktionov <redacted>
```
