diff mbox series

[RFCv2,net-next,077/167] net: can: use netdev feature helpers

Message ID 20210929155334.12454-78-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:52 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/can/dev/dev.c | 3 ++-
 drivers/net/can/slcan.c   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index e3d840b81357..97c61943125e 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -233,7 +233,8 @@  void can_setup(struct net_device *dev)
 
 	/* New-style flags. */
 	dev->flags = IFF_NOARP;
-	dev->features = NETIF_F_HW_CSUM;
+	netdev_feature_zero(&dev->features);
+	netdev_feature_set_bit(NETIF_F_HW_CSUM_BIT, &dev->features);
 }
 
 /* Allocate and setup space for the CAN network device */
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index d42ec7d1bc14..8af2cf00a021 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -450,7 +450,8 @@  static void slc_setup(struct net_device *dev)
 
 	/* New-style flags. */
 	dev->flags		= IFF_NOARP;
-	dev->features           = NETIF_F_HW_CSUM;
+	netdev_feature_zero(&dev->features);
+	netdev_feature_set_bit(NETIF_F_HW_CSUM_BIT, &dev->features);
 }
 
 /******************************************