diff mbox series

[RFCv8,net-next,35/55] treewide: use netdev_features_empty helpers

Message ID 20220918094336.28958-36-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: 3 this patch: 3
netdev/cc_maintainers warning 9 maintainers not CCed: manishc@marvell.com aelior@marvell.com jesse.brandeburg@intel.com edumazet@google.com pabeni@redhat.com intel-wired-lan@lists.osuosl.org skalluru@marvell.com michael.chan@broadcom.com anthony.l.nguyen@intel.com
netdev/build_clang fail Errors and warnings before: 64 this patch: 64
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: 376 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 56 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) Sept. 18, 2022, 9:43 a.m. UTC
Replace the empty checking expressions of features by
netdev_features_empty helpers.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c       | 2 +-
 drivers/net/ethernet/intel/iavf/iavf_main.c     | 2 +-
 drivers/net/ethernet/intel/ice/ice_main.c       | 4 ++--
 net/ethtool/ioctl.c                             | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 1095cfb0783a..53b6ed00e124 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -4965,7 +4965,7 @@  int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
 	/* Don't care about GRO changes */
 	netdev_feature_del(NETIF_F_GRO_BIT, changes);
 
-	if (changes)
+	if (!netdev_features_empty(changes))
 		bnx2x_reload = true;
 
 	if (bnx2x_reload) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 27a45adb7672..e8ccccb07045 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11198,7 +11198,7 @@  static netdev_features_t bnxt_fix_features(struct net_device *dev,
 		if (netdev_active_features_intersects(dev, BNXT_HW_FEATURE_VLAN_ALL_RX))
 			netdev_features_clear(features,
 					      BNXT_HW_FEATURE_VLAN_ALL_RX);
-		else if (vlan_features)
+		else if (!netdev_features_empty(vlan_features))
 			netdev_features_set(features,
 					    BNXT_HW_FEATURE_VLAN_ALL_RX);
 	}
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 955f9f8ce66e..2cc85f1a81df 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -4825,7 +4825,7 @@  int iavf_process_config(struct iavf_adapter *adapter)
 	/* Do not turn on offloads when they are requested to be turned off.
 	 * TSO needs minimum 576 bytes to work correctly.
 	 */
-	if (netdev->wanted_features) {
+	if (!netdev_wanted_features_empty(netdev)) {
 		if (!netdev_wanted_feature_test(netdev, NETIF_F_TSO_BIT) ||
 		    netdev->mtu < 576)
 			netdev_active_feature_del(netdev, NETIF_F_TSO_BIT);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d52775c16a81..b69357c220d9 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5974,7 +5974,7 @@  ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
 			    NETIF_VLAN_OFFLOAD_FEATURES);
 	netdev_features_xor(diff, current_vlan_features,
 			    requested_vlan_features);
-	if (diff) {
+	if (!netdev_features_empty(diff)) {
 		if (netdev_feature_test(NETIF_F_RXFCS_BIT, features) &&
 		    netdev_features_intersects(features,
 					       NETIF_VLAN_STRIPPING_FEATURES)) {
@@ -5994,7 +5994,7 @@  ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
 			    NETIF_VLAN_FILTERING_FEATURES);
 	netdev_features_xor(diff, current_vlan_features,
 			    requested_vlan_features);
-	if (diff) {
+	if (!netdev_features_empty(diff)) {
 		err = ice_set_vlan_filtering_features(vsi, features);
 		if (err)
 			return err;
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index e3897766781f..c4154666e82a 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -293,7 +293,7 @@  static int ethtool_set_one_feature(struct net_device *dev,
 
 	mask = ethtool_get_feature_mask(ethcmd);
 	netdev_features_mask(mask, dev->hw_features);
-	if (!mask)
+	if (netdev_features_empty(mask))
 		return -EOPNOTSUPP;
 
 	if (edata.data)
@@ -359,7 +359,7 @@  static int __ethtool_set_flags(struct net_device *dev, u32 data)
 	netdev_features_xor(changed, dev->features, features);
 	netdev_features_mask(changed, eth_all_features);
 	netdev_features_andnot(tmp, changed, dev->hw_features);
-	if (tmp)
+	if (!netdev_features_empty(tmp))
 		return netdev_hw_features_intersects(dev, changed) ?
 			-EINVAL : -EOPNOTSUPP;