[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210929155334.12454-127-shenjian15@huawei.com>
Date: Wed, 29 Sep 2021 23:52:53 +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 126/167] net: aeroflex: 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/ethernet/aeroflex/greth.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index c560ad06f0be..2c0fc8103386 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -914,7 +914,9 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
skb_put(skb, pkt_len);
- if (dev->features & NETIF_F_RXCSUM && hw_checksummed(status))
+ if (netdev_feature_test_bit(NETIF_F_RXCSUM_BIT,
+ dev->features) &&
+ hw_checksummed(status))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -1483,9 +1485,11 @@ static int greth_of_probe(struct platform_device *ofdev)
GRETH_REGSAVE(regs->status, 0xFF);
if (greth->gbit_mac) {
- dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
- NETIF_F_RXCSUM;
- dev->features = dev->hw_features | NETIF_F_HIGHDMA;
+ netdev_feature_zero(&dev->hw_features);
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM, &dev->hw_features);
+ netdev_feature_copy(&dev->features, dev->hw_features);
+ netdev_feature_set_bit(NETIF_F_HIGHDMA_BIT, &dev->features);
greth_netdev_ops.ndo_start_xmit = greth_start_xmit_gbit;
}
--
2.33.0
Powered by blists - more mailing lists