DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Gouin <maxime.gouin@6wind.com>
To: dev@dpdk.org
Cc: Maxime Gouin <maxime.gouin@6wind.com>,
	Heinrich Kuhn <heinrich.kuhn@corigine.com>,
	Alejandro Lucero <alejandro.lucero@netronome.com>,
	Olivier Matz <olivier.matz@6wind.com>
Subject: [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address
Date: Wed,  5 Jan 2022 11:32:02 +0100	[thread overview]
Message-ID: <20220105103203.7166-1-maxime.gouin@6wind.com> (raw)

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 <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
---
 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


             reply	other threads:[~2022-01-06  8:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 10:32 Maxime Gouin [this message]
2022-01-05 10:32 ` [PATCH 2/2] net/nfp: remove useless range checks Maxime Gouin
2022-01-11 14:54   ` Kevin Traynor
2022-01-21 14:39     ` Ferruh Yigit
2022-01-11 14:46 ` [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220105103203.7166-1-maxime.gouin@6wind.com \
    --to=maxime.gouin@6wind.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=dev@dpdk.org \
    --cc=heinrich.kuhn@corigine.com \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).