diff mbox series

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

Message ID 20210929155334.12454-71-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the netdev_features_t | expand

Commit Message

shenjian (K) Sept. 29, 2021, 3:51 p.m. UTC
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 mbox series

Patch

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;