[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220324154932.17557-17-shenjian15@huawei.com>
Date: Thu, 24 Mar 2022 23:49:28 +0800
From: Jian Shen <shenjian15@...wei.com>
To: <davem@...emloft.net>, <kuba@...nel.org>, <andrew@...n.ch>,
<ecree.xilinx@...il.com>, <hkallweit1@...il.com>,
<alexandr.lobakin@...el.com>, <saeed@...nel.org>, <leon@...nel.org>
CC: <netdev@...r.kernel.org>, <linuxarm@...neuler.org>,
<lipeng321@...wei.com>
Subject: [RFCv5 PATCH net-next 16/20] net: use netdev_features_subset helpers
Replace the 'f1 & f2 == f2' operations of features by
netdev_features_subset helpers.
Signed-off-by: Jian Shen <shenjian15@...wei.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);
--
2.33.0
Powered by blists - more mailing lists