@@ -1217,27 +1217,27 @@ typedef int (*mlxsw_sp_feature_handler)(struct net_device *dev, bool enable);
static int mlxsw_sp_handle_feature(struct net_device *dev,
netdev_features_t wanted_features,
- netdev_features_t feature,
+ int feature_bit,
mlxsw_sp_feature_handler feature_handler)
{
netdev_features_t changes = wanted_features ^ dev->features;
- bool enable = !!(wanted_features & feature);
+ bool enable = netdev_feature_test(feature_bit, wanted_features);
int err;
- if (!(changes & feature))
+ if (!netdev_feature_test(feature_bit, changes))
return 0;
err = feature_handler(dev, enable);
if (err) {
- netdev_err(dev, "%s feature %pNF failed, err %d\n",
- enable ? "Enable" : "Disable", &feature, err);
+ netdev_err(dev, "%s feature bit %d failed, err %d\n",
+ enable ? "Enable" : "Disable", feature_bit, err);
return err;
}
if (enable)
- dev->features |= feature;
+ netdev_active_feature_add(dev, feature_bit);
else
- dev->features &= ~feature;
+ netdev_active_feature_del(dev, feature_bit);
return 0;
}
@@ -1247,9 +1247,9 @@ static int mlxsw_sp_set_features(struct net_device *dev,
netdev_features_t oper_features = dev->features;
int err = 0;
- err |= mlxsw_sp_handle_feature(dev, features, NETIF_F_HW_TC,
+ err |= mlxsw_sp_handle_feature(dev, features, NETIF_F_HW_TC_BIT,
mlxsw_sp_feature_hw_tc);
- err |= mlxsw_sp_handle_feature(dev, features, NETIF_F_LOOPBACK,
+ err |= mlxsw_sp_handle_feature(dev, features, NETIF_F_LOOPBACK_BIT,
mlxsw_sp_feature_loopback);
if (err) {
The function mlxsw_sp_handle_feature() use NETIF_F_XXX as input parameter directly, change it to use NETIF_F_XXX_BIT, for all the NETIF_F_XXX macroes will be removed later. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)