diff mbox series

[RFCv7,net-next,26/36] treewide: use netdev_feature_change helpers

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

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 106 this patch: 138
netdev/cc_maintainers warning 23 maintainers not CCed: gor@linux.ibm.com haiyangz@microsoft.com sthemmin@microsoft.com edumazet@google.com linux-hyperv@vger.kernel.org wenjia@linux.ibm.com awogbemila@google.com linux-s390@vger.kernel.org kys@microsoft.com GR-Linux-NIC-Dev@marvell.com hca@linux.ibm.com rajur@chelsio.com wei.liu@kernel.org borntraeger@linux.ibm.com wintera@linux.ibm.com jeroendb@google.com pabeni@redhat.com csully@google.com shshaikh@marvell.com svens@linux.ibm.com agordeev@linux.ibm.com decui@microsoft.com manishc@marvell.com
netdev/build_clang fail Errors and warnings before: 23 this patch: 27
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 216 this patch: 198
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 76 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Aug. 10, 2022, 3:06 a.m. UTC
Replace the '^=' expressions of single feature bit by
netdev_feature_change helpers.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |  2 +-
 drivers/net/ethernet/google/gve/gve_main.c      |  2 +-
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c  |  2 +-
 drivers/net/hyperv/netvsc_drv.c                 |  4 ++--
 drivers/s390/net/qeth_core_main.c               | 10 +++++-----
 5 files changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index fd2e42662dd5..316fa87237b2 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1285,7 +1285,7 @@  static int cxgb_set_features(struct net_device *dev, netdev_features_t features)
 			    !!(features & NETIF_F_HW_VLAN_CTAG_RX), true);
 	if (unlikely(err)) {
 		dev->features = features;
-		dev->features ^= NETIF_F_HW_VLAN_CTAG_RX;
+		netdev_active_feature_change(dev, NETIF_F_HW_VLAN_CTAG_RX_BIT);
 	}
 	return err;
 }
diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
index 357e2d9cd740..dd7bc0374d6f 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -1186,7 +1186,7 @@  static int gve_set_features(struct net_device *netdev,
 	int err;
 
 	if ((netdev->features & NETIF_F_LRO) != (features & NETIF_F_LRO)) {
-		netdev->features ^= NETIF_F_LRO;
+		netdev_active_feature_change(netdev, NETIF_F_LRO_BIT);
 		if (netif_carrier_ok(netdev)) {
 			/* To make this process as simple as possible we
 			 * teardown the device, set the new configuration,
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index fc51958cd77a..ab7e234132ed 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -1100,7 +1100,7 @@  int qlcnic_set_features(struct net_device *netdev, netdev_features_t features)
 	if (!(changed & NETIF_F_LRO))
 		return 0;
 
-	netdev->features ^= NETIF_F_LRO;
+	netdev_active_feature_change(netdev, NETIF_F_LRO_BIT);
 
 	if (qlcnic_config_hw_lro(adapter, hw_lro))
 		return -EIO;
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 72f0500ae697..e241f9a1fca7 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1910,7 +1910,7 @@  static netdev_features_t netvsc_fix_features(struct net_device *ndev,
 		return features;
 
 	if ((features & NETIF_F_LRO) && netvsc_xdp_get(nvdev)) {
-		features ^= NETIF_F_LRO;
+		netdev_feature_change(NETIF_F_LRO_BIT, &features);
 		netdev_info(ndev, "Skip LRO - unsupported with XDP\n");
 	}
 
@@ -1946,7 +1946,7 @@  static int netvsc_set_features(struct net_device *ndev,
 	ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads);
 
 	if (ret) {
-		features ^= NETIF_F_LRO;
+		netdev_feature_change(NETIF_F_LRO_BIT, &features);
 		ndev->features = features;
 	}
 
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 0d3d0ffdb46b..39e0bd7ba519 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6871,31 +6871,31 @@  int qeth_set_features(struct net_device *dev, netdev_features_t features)
 				       IPA_OUTBOUND_CHECKSUM, QETH_PROT_IPV4,
 				       &card->info.has_lp2lp_cso_v4);
 		if (rc)
-			changed ^= NETIF_F_IP_CSUM;
+			netdev_feature_change(NETIF_F_IP_CSUM_BIT, &changed);
 	}
 	if (changed & NETIF_F_IPV6_CSUM) {
 		rc = qeth_set_ipa_csum(card, features & NETIF_F_IPV6_CSUM,
 				       IPA_OUTBOUND_CHECKSUM, QETH_PROT_IPV6,
 				       &card->info.has_lp2lp_cso_v6);
 		if (rc)
-			changed ^= NETIF_F_IPV6_CSUM;
+			netdev_feature_change(NETIF_F_IPV6_CSUM_BIT, &changed);
 	}
 	if (changed & NETIF_F_RXCSUM) {
 		rc = qeth_set_ipa_rx_csum(card, features & NETIF_F_RXCSUM);
 		if (rc)
-			changed ^= NETIF_F_RXCSUM;
+			netdev_feature_change(NETIF_F_RXCSUM_BIT, &changed);
 	}
 	if (changed & NETIF_F_TSO) {
 		rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO,
 				      QETH_PROT_IPV4);
 		if (rc)
-			changed ^= NETIF_F_TSO;
+			netdev_feature_change(NETIF_F_TSO_BIT, &changed);
 	}
 	if (changed & NETIF_F_TSO6) {
 		rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO6,
 				      QETH_PROT_IPV6);
 		if (rc)
-			changed ^= NETIF_F_TSO6;
+			netdev_feature_change(NETIF_F_TSO6_BIT, &changed);
 	}
 
 	qeth_check_restricted_features(card, dev->features ^ features,