Thread (181 messages) 181 messages, 6 authors, 2022-01-27

[RFCv2 net-next 070/167] net: ifb: use netdev feature helpers

From: Jian Shen <shenjian15@huawei.com>
Date: 2021-09-29 16:00:03
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Use netdev_feature_xxx helpers to replace the logical operation
for netdev features.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ifb.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index e9258a9f3702..c7cf224f8bed 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -213,11 +213,13 @@ static void ifb_setup(struct net_device *dev)
 	ether_setup(dev);
 	dev->tx_queue_len = TX_Q_LIMIT;
 
-	dev->features |= IFB_FEATURES;
-	dev->hw_features |= dev->features;
-	dev->hw_enc_features |= dev->features;
-	dev->vlan_features |= IFB_FEATURES & ~(NETIF_F_HW_VLAN_CTAG_TX |
-					       NETIF_F_HW_VLAN_STAG_TX);
+	netdev_feature_set_bits(IFB_FEATURES, &dev->features);
+	netdev_feature_or(&dev->hw_features, dev->hw_features, dev->features);
+	netdev_feature_or(&dev->hw_enc_features, dev->hw_enc_features,
+			  dev->features);
+	netdev_feature_set_bits(IFB_FEATURES & ~(NETIF_F_HW_VLAN_CTAG_TX |
+						 NETIF_F_HW_VLAN_STAG_TX),
+				&dev->vlan_features);
 
 	dev->flags |= IFF_NOARP;
 	dev->flags &= ~IFF_MULTICAST;
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help