Replace the '(f1 & f2) == f2' expressions of features by netdev_features_subset helpers.
Signed-off-by: Jian Shen shenjian15@huawei.com --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- net/core/dev.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index f6015c49363e..a4751aa92ddf 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -2200,7 +2200,7 @@ static netdev_features_t xgbe_fix_features(struct net_device *netdev, }
/* Can't do one without doing the other */ - if ((features & vxlan_base) != vxlan_base) { + if (!netdev_features_subset(vxlan_base, features)) { netdev_notice(netdev, "forcing both tx and rx udp tunnel support\n"); netdev_features_set(&features, vxlan_base); diff --git a/net/core/dev.c b/net/core/dev.c index b97b9316dbde..01340e889e72 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9695,8 +9695,7 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, }
if (netdev_feature_test(NETIF_F_HW_TLS_TX_BIT, features)) { - bool ip_csum = (features & netdev_ip_csum_features) == - netdev_ip_csum_features; + bool ip_csum = netdev_features_subset(netdev_ip_csum_features, features); bool hw_csum = netdev_feature_test(NETIF_F_HW_CSUM_BIT, features);