diff mbox series

[RFCv8,net-next,34/55] treewide: use netdev_features_equal helpers

Message ID 20220918094336.28958-35-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 success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 21 maintainers not CCed: jesse.brandeburg@intel.com tlfalcon@linux.ibm.com michael.chan@broadcom.com hca@linux.ibm.com npiggin@gmail.com pabeni@redhat.com agordeev@linux.ibm.com wintera@linux.ibm.com mpe@ellerman.id.au wenjia@linux.ibm.com anthony.l.nguyen@intel.com christophe.leroy@csgroup.eu edumazet@google.com habetsm.xilinx@gmail.com svens@linux.ibm.com linux-s390@vger.kernel.org borntraeger@linux.ibm.com intel-wired-lan@lists.osuosl.org linuxppc-dev@lists.ozlabs.org gor@linux.ibm.com drt@linux.ibm.com
netdev/build_clang fail Errors and warnings before: 70 this patch: 70
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: 15 this patch: 15
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Sept. 18, 2022, 9:43 a.m. UTC
Replace the 'f1 == f2' and 'f1 != f2' features expressions by
netdev_features_equal helpers.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c   | 2 +-
 drivers/net/ethernet/ibm/ibmvnic.c          | 2 +-
 drivers/net/ethernet/intel/ice/ice_main.c   | 2 +-
 drivers/net/ethernet/sfc/efx_common.c       | 2 +-
 drivers/net/ethernet/sfc/falcon/efx.c       | 2 +-
 drivers/net/ethernet/sfc/siena/efx_common.c | 2 +-
 drivers/s390/net/qeth_core_main.c           | 4 ++--
 net/core/dev.c                              | 2 +-
 net/ethtool/ioctl.c                         | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index ce886feeefdc..27a45adb7672 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11194,7 +11194,7 @@  static netdev_features_t bnxt_fix_features(struct net_device *dev,
 	 */
 	netdev_features_and(vlan_features, features,
 			    BNXT_HW_FEATURE_VLAN_ALL_RX);
-	if (vlan_features != BNXT_HW_FEATURE_VLAN_ALL_RX) {
+	if (!netdev_features_equal(vlan_features, BNXT_HW_FEATURE_VLAN_ALL_RX)) {
 		if (netdev_active_features_intersects(dev, BNXT_HW_FEATURE_VLAN_ALL_RX))
 			netdev_features_clear(features,
 					      BNXT_HW_FEATURE_VLAN_ALL_RX);
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 9c6fb5e21cb4..6f84086ddfe2 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -4892,7 +4892,7 @@  static void send_control_ip_offload(struct ibmvnic_adapter *adapter)
 	if (adapter->state == VNIC_PROBING) {
 		netdev_active_features_set(adapter->netdev,
 					   adapter->netdev->hw_features);
-	} else if (old_hw_features != adapter->netdev->hw_features) {
+	} else if (!netdev_hw_features_equal(adapter->netdev, old_hw_features)) {
 		netdev_features_t tmp;
 
 		netdev_features_zero(tmp);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index ec148c43c130..d52775c16a81 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5834,7 +5834,7 @@  ice_fix_features(struct net_device *netdev, netdev_features_t features)
 	req_stag = netdev_feature_test(NETIF_F_HW_VLAN_STAG_FILTER_BIT,
 				       req_vlan_fltr);
 
-	if (req_vlan_fltr != cur_vlan_fltr) {
+	if (!netdev_features_equal(req_vlan_fltr, cur_vlan_fltr)) {
 		if (ice_is_dvm_ena(&np->vsi->back->hw)) {
 			if (req_ctag && req_stag) {
 				netdev_features_set(features,
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index 8e6a86be924e..9a52492f3f06 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -417,7 +417,7 @@  static void efx_start_datapath(struct efx_nic *efx)
 	netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
 	netdev_hw_features_clear(efx->net_dev, efx->fixed_features);
 	netdev_active_features_set(efx->net_dev, efx->fixed_features);
-	if (efx->net_dev->features != old_features)
+	if (!netdev_active_features_equal(efx->net_dev, old_features))
 		netdev_features_change(efx->net_dev);
 
 	/* RX filters may also have scatter-enabled flags */
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 8b37fc2e134e..232e8fde0a81 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -638,7 +638,7 @@  static void ef4_start_datapath(struct ef4_nic *efx)
 	netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
 	netdev_hw_features_clear(efx->net_dev, efx->fixed_features);
 	netdev_active_features_set(efx->net_dev, efx->fixed_features);
-	if (efx->net_dev->features != old_features)
+	if (!netdev_active_features_equal(efx->net_dev, old_features))
 		netdev_features_change(efx->net_dev);
 
 	/* RX filters may also have scatter-enabled flags */
diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c
index dcbb23a71c4d..5360c6d6c026 100644
--- a/drivers/net/ethernet/sfc/siena/efx_common.c
+++ b/drivers/net/ethernet/sfc/siena/efx_common.c
@@ -416,7 +416,7 @@  static void efx_start_datapath(struct efx_nic *efx)
 	netdev_hw_features_set(efx->net_dev, efx->net_dev->features);
 	netdev_hw_features_clear(efx->net_dev, efx->fixed_features);
 	netdev_active_features_set(efx->net_dev, efx->fixed_features);
-	if (efx->net_dev->features != old_features)
+	if (!netdev_active_features_equal(efx->net_dev, old_features))
 		netdev_features_change(efx->net_dev);
 
 	/* RX filters may also have scatter-enabled flags */
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index c7c0b8853452..72c487009c33 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6757,7 +6757,7 @@  void qeth_enable_hw_features(struct net_device *dev)
 					  NETIF_F_HW_VLAN_CTAG_FILTER_BIT);
 	}
 	netdev_update_features(dev);
-	if (features != dev->features)
+	if (!netdev_active_features_equal(dev, features))
 		dev_warn(&card->gdev->dev,
 			 "Device recovery failed to restore all offload features\n");
 }
@@ -6842,7 +6842,7 @@  int qeth_set_features(struct net_device *dev, netdev_features_t features)
 	qeth_check_restricted_features(card, diff1, diff2);
 
 	/* everything changed successfully? */
-	if (diff1 == changed)
+	if (netdev_features_equal(diff1, changed))
 		return 0;
 	/* something went wrong. save changed features and return error */
 	netdev_active_features_toggle(dev, changed);
diff --git a/net/core/dev.c b/net/core/dev.c
index 8d1dc83182a2..f790f1986dd3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9741,7 +9741,7 @@  int __netdev_update_features(struct net_device *dev)
 	netdev_for_each_upper_dev_rcu(dev, upper, iter)
 		features = netdev_sync_upper_features(dev, upper, features);
 
-	if (dev->features == features)
+	if (netdev_active_features_equal(dev, features))
 		goto sync_lower;
 
 	netdev_dbg(dev, "Features changed: %pNF -> %pNF\n",
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index a094c9e14d3d..e3897766781f 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -3033,7 +3033,7 @@  __dev_ethtool(struct net *net, struct ifreq *ifr, void __user *useraddr,
 	if (dev->ethtool_ops->complete)
 		dev->ethtool_ops->complete(dev);
 
-	if (old_features != dev->features)
+	if (!netdev_active_features_equal(dev, old_features))
 		netdev_features_change(dev);
 out:
 	if (dev->dev.parent)