From patchwork Thu Mar 24 15:49:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "shenjian (K)" X-Patchwork-Id: 12790811 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 1B0EFC433FE for ; Thu, 24 Mar 2022 15:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351445AbiCXP5T (ORCPT ); Thu, 24 Mar 2022 11:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351437AbiCXP4s (ORCPT ); Thu, 24 Mar 2022 11:56:48 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F93CAC92F for ; Thu, 24 Mar 2022 08:55:11 -0700 (PDT) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KPVBS0H98zfZML; Thu, 24 Mar 2022 23:53:36 +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.2308.21; Thu, 24 Mar 2022 23:55:10 +0800 From: Jian Shen To: , , , , , , , CC: , , Subject: [RFCv5 PATCH net-next 17/20] net: use netdev_features_equal helpers Date: Thu, 24 Mar 2022 23:49:29 +0800 Message-ID: <20220324154932.17557-18-shenjian15@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220324154932.17557-1-shenjian15@huawei.com> References: <20220324154932.17557-1-shenjian15@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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 '==' and '!=' operations of features by netdev_features_equal helpers. Signed-off-by: Jian Shen --- drivers/net/ethernet/sfc/efx_common.c | 2 +- drivers/net/ethernet/sfc/falcon/efx.c | 2 +- net/core/dev.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c index d2874aad3ce7..fd6eb74b4fa6 100644 --- a/drivers/net/ethernet/sfc/efx_common.c +++ b/drivers/net/ethernet/sfc/efx_common.c @@ -418,7 +418,7 @@ static void efx_start_datapath(struct efx_nic *efx) efx->net_dev->active_features); netdev_hw_features_direct_andnot(efx->net_dev, efx->fixed_features); netdev_active_features_direct_or(efx->net_dev, efx->fixed_features); - if (efx->net_dev->active_features != old_features) + if (!netdev_active_features_equal(efx->net_dev, old_features)) netdev_features_change(efx->net_dev); /* RX filters may also have scatter-enabled flags */ diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c index efa3054cba35..22ea294a39fa 100644 --- a/drivers/net/ethernet/sfc/falcon/efx.c +++ b/drivers/net/ethernet/sfc/falcon/efx.c @@ -645,7 +645,7 @@ static void ef4_start_datapath(struct ef4_nic *efx) efx->net_dev->active_features); netdev_hw_features_direct_andnot(efx->net_dev, efx->fixed_features); netdev_active_features_direct_or(efx->net_dev, efx->fixed_features); - if (efx->net_dev->active_features != old_features) + if (!netdev_active_features_equal(efx->net_dev, old_features)) netdev_features_change(efx->net_dev); /* RX filters may also have scatter-enabled flags */ diff --git a/net/core/dev.c b/net/core/dev.c index bb3c1b55cc2e..57409f97feb1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9613,7 +9613,7 @@ int __netdev_update_features(struct net_device *dev) netdev_for_each_upper_dev_rcu(dev, upper, iter) features = netdev_sync_upper_features(dev, upper, features); - if (dev->active_features == features) + if (netdev_active_features_equal(dev, features)) goto sync_lower; netdev_dbg(dev, "Features changed: %pNF -> %pNF\n",