Replace the 'f1 & f2 == f2' operations of features by netdev_features_subset helpers.
Signed-off-by: Jian Shen shenjian15@huawei.com --- include/linux/netdevice.h | 2 +- net/core/dev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ad24bd0c69a3..13f397c5960c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5487,7 +5487,7 @@ static inline bool net_gso_ok(netdev_features_t features, int gso_type) BUILD_BUG_ON(SKB_GSO_UDP_L4 != (NETIF_F_GSO_UDP_L4 >> NETIF_F_GSO_SHIFT)); BUILD_BUG_ON(SKB_GSO_FRAGLIST != (NETIF_F_GSO_FRAGLIST >> NETIF_F_GSO_SHIFT));
- return (features & feature) == feature; + return netdev_features_subset(features, features); }
static inline bool skb_gso_ok(struct sk_buff *skb, netdev_features_t features) diff --git a/net/core/dev.c b/net/core/dev.c index a540784c69be..bb3c1b55cc2e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9571,8 +9571,8 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, }
if (netdev_features_test_bit(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(features, + netdev_ip_csum_features); bool hw_csum = netdev_features_test_bit(NETIF_F_HW_CSUM_BIT, features);