@@ -4963,7 +4963,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) {
@@ -11203,7 +11203,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);
}
@@ -4690,7 +4690,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);
@@ -5922,7 +5922,7 @@ ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
requested_vlan_features = netdev_features_and(features,
NETIF_VLAN_OFFLOAD_FEATURES);
diff = netdev_features_xor(current_vlan_features, requested_vlan_features);
- if (diff) {
+ if (!netdev_features_empty(diff)) {
err = ice_set_vlan_offload_features(vsi, features);
if (err)
return err;
@@ -5933,7 +5933,7 @@ ice_set_vlan_features(struct net_device *netdev, netdev_features_t features)
requested_vlan_features = netdev_features_and(features,
NETIF_VLAN_FILTERING_FEATURES);
diff = netdev_features_xor(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;
@@ -290,7 +290,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)
changed = netdev_active_features_xor(dev, features);
netdev_features_mask(&changed, eth_all_features);
tmp = netdev_hw_features_andnot_r(dev, changed);
- if (tmp)
+ if (!netdev_features_empty(tmp))
return netdev_hw_features_intersects(dev, changed) ?
-EINVAL : -EOPNOTSUPP;
Replace the empty checking expressions of features by netdev_features_subset 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(-)