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
Also in
lkml
Reply to
Uwe Kleine-König (The Capable Hub), 2026-05-07
quoted hunk ↗ jump to hunk
-----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
[off-list ref]; Eric Dumazet [off-list ref]; Paolo Abeni
[off-list ref]
Cc: Loktionov, Aleksandr <redacted>; Petr Machata
[off-list ref]; Johannes Berg [off-list ref]; Arend
van Spriel [off-list ref]; Marco Crivellari
[off-list ref]; Kees Cook [off-list ref]; Jakub
Kicinski [off-list ref]; Simon Horman [off-list ref]; oss-
drivers@corigine.com; netdev@vger.kernel.org; linux-
kernel@vger.kernel.org; Markus Schneider-Pargmann [off-list 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>
Thread (9 messages) 9 messages, 4 authors, last reply 2026-05-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help