From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F928A034D; Thu, 6 Jan 2022 09:41:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D5B041140; Thu, 6 Jan 2022 09:41:36 +0100 (CET) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mails.dpdk.org (Postfix) with ESMTP id 766E54014F for ; Wed, 5 Jan 2022 11:32:25 +0100 (CET) Received: by mail-wr1-f45.google.com with SMTP id e5so81999930wrc.5 for ; Wed, 05 Jan 2022 02:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iluSdXNW98q+cxkbh2Si9orG5tXPP3YXLwJL/94DhMc=; b=SMTpNbO2RYXi4JTzH5zW93KctKDy8VGCEop9Vuzyshvzf1Lodym0CHq8yXAbQpMUWg kV7SMJs/w3yfJZ2XfnpZM9LTMosNaTOdfw+HkdjzW2IgBNDLCnCjGigBGYFzukK0EJPv IGVHW0Al5a4CAICoU+vRuNWdJZWHVO+Isblxx2X2vAYYauMMVczP8Mfbppwnq4aBCyKL /H8poGbakpxo1RJ2szQWpOOXL/GIy0IAyQTfqVIYG2Ocb0/omVcTmcIIzQnqLS7NchLV NeCzV/vYtmN9+UHA98g0tSDN7Dtp1G80vQRVXDpBNw6p6s8pHL0MmkVJjDCJYzJg3ch5 jvxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iluSdXNW98q+cxkbh2Si9orG5tXPP3YXLwJL/94DhMc=; b=KwFgIEc1os0q0OBCi4uCOncya5vuhwysSqsk8f3cvEYqdCcUnmBBfGhCjbCFuPJIqj pX8vvQvewnSaeIjKWzKmv0cvVX/3raR2mwCrkVXHy4Cz0z/jys4L0BwJXOfHQvWWR5r+ 4GQaPbSP3oLxfsAniMeLnieEIV0lfeS6T7PlHxkTWulyUztCFNvCEjhIHua+6/QWiS4P G5/f31Pwh0bY0pGMv95xxTLl6DmQERdTiFIgxsNXDNsWi/5H4w9gotF52FQW5JLJyjYh /A7Ah2Mbkkj/wlERqDwGGhqe7MjVs92i9RDn/PpKUhsUZVFfuJmB9zLnYpJk9qgyayKD aKbg== X-Gm-Message-State: AOAM532/el+OKRFsfiUYD6kTg+Qi2mRiwNddOafruhM93ZZy7kY9cDOt 7DgIfAJNtInWPiTFw7NYYYFth1Vk3eudfQy3 X-Google-Smtp-Source: ABdhPJyAgbmAU3QWbNttUkJR3iKaxAdM82BvUPVzF1MvmLeL7AcTOEXcBjVHHrxDt3OOjxJY5G6zbA== X-Received: by 2002:a5d:46d0:: with SMTP id g16mr48266230wrs.624.1641378745164; Wed, 05 Jan 2022 02:32:25 -0800 (PST) Received: from dokken.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id j11sm1777677wmq.23.2022.01.05.02.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 02:32:24 -0800 (PST) From: Maxime Gouin To: dev@dpdk.org Cc: Maxime Gouin , Heinrich Kuhn , Alejandro Lucero , Olivier Matz Subject: [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address Date: Wed, 5 Jan 2022 11:32:02 +0100 Message-Id: <20220105103203.7166-1-maxime.gouin@6wind.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 06 Jan 2022 09:41:34 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org reported by code analysis tool C++test (version 10.4): > /build/dpdk-20.11/drivers/net/nfp/nfp_net.c > 546 Conditions "(hw->ctrl &NFP_NET_CFG_CTRL_ENABLE) && !! (hw->cap &NFP_NET_CFG_C" is always evaluated to false > 547 Condition "! (hw->cap &NFP_NET_CFG_C" is always evaluated to false The previous "if" checks exactly the same condition. Removal of duplicate code. Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change") Signed-off-by: Maxime Gouin Reviewed-by: Olivier Matz --- drivers/net/nfp/nfp_common.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index f8978e803a0f..b26770dbfbe4 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -280,10 +280,6 @@ nfp_set_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) return -EBUSY; } - if ((hw->ctrl & NFP_NET_CFG_CTRL_ENABLE) && - !(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) - return -EBUSY; - /* Writing new MAC to the specific port BAR address */ nfp_net_write_mac(hw, (uint8_t *)mac_addr); -- 2.30.2