From patchwork Sun Sep 18 09:43:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "shenjian (K)" X-Patchwork-Id: 12979422 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 651D5C54EE9 for ; Sun, 18 Sep 2022 09:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbiIRJvP (ORCPT ); Sun, 18 Sep 2022 05:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbiIRJuV (ORCPT ); Sun, 18 Sep 2022 05:50:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E6E111A3B for ; Sun, 18 Sep 2022 02:49:57 -0700 (PDT) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MVjc92Cy6zmVN5; Sun, 18 Sep 2022 17:46:01 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 18 Sep 2022 17:49:52 +0800 From: Jian Shen To: , , , , , , , CC: , Subject: [RFCv8 PATCH net-next 33/55] treewide: use netdev_features_subset helpers Date: Sun, 18 Sep 2022 09:43:14 +0000 Message-ID: <20220918094336.28958-34-shenjian15@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220918094336.28958-1-shenjian15@huawei.com> References: <20220918094336.28958-1-shenjian15@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Replace the '(f1 & f2) == f2' expressions of features by netdev_features_subset helpers. Signed-off-by: Jian Shen --- 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 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);