[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929155334.12454-69-shenjian15@huawei.com>
Date: Wed, 29 Sep 2021 23:51:55 +0800
From: Jian Shen <shenjian15@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <andrew@...n.ch>,
<hkallweit1@...il.com>
CC: <netdev@...r.kernel.org>, <linuxarm@...neuler.org>
Subject: [RFCv2 net-next 068/167] net: dummy: use netdev_feature helpers
Use netdev_feature_xxx helpers to replace the logical operation
for netdev features.
Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
drivers/net/dummy.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index f82ad7419508..54ebb638a57b 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -123,12 +123,14 @@ static void dummy_setup(struct net_device *dev)
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
- dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
- dev->features |= NETIF_F_GSO_SOFTWARE;
- dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
- dev->features |= NETIF_F_GSO_ENCAP_ALL;
- dev->hw_features |= dev->features;
- dev->hw_enc_features |= dev->features;
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_FRAGLIST, &dev->features);
+ netdev_feature_set_bits(NETIF_F_GSO_SOFTWARE, &dev->features);
+ netdev_feature_set_bits(NETIF_F_HW_CSUM | NETIF_F_HIGHDMA |
+ NETIF_F_LLTX, &dev->features);
+ netdev_feature_set_bits(NETIF_F_GSO_ENCAP_ALL, &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);
eth_hw_addr_random(dev);
dev->min_mtu = 0;
--
2.33.0
Powered by blists - more mailing lists