diff mbox series

[RFCv8,net-next,33/55] treewide: use netdev_features_subset helpers

Message ID 20220918094336.28958-34-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the type of netdev_features_t to bitmap | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count fail Series longer than 15 patches (and no cover letter)
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 4 maintainers not CCed: edumazet@google.com thomas.lendacky@amd.com pabeni@redhat.com Shyam-sundar.S-k@amd.com
netdev/build_clang fail Errors and warnings before: 286 this patch: 1160
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 52 this patch: 199
netdev/checkpatch warning WARNING: line length of 89 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shenjian (K) Sept. 18, 2022, 9:43 a.m. UTC
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 mbox series

Patch

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 212826228890..92e722c356e0 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -2199,7 +2199,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 10e74f33147e..8d1dc83182a2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9701,8 +9701,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);