DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address
@ 2022-01-05 10:32 Maxime Gouin
  2022-01-05 10:32 ` [PATCH 2/2] net/nfp: remove useless range checks Maxime Gouin
  2022-01-11 14:46 ` [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address Kevin Traynor
  0 siblings, 2 replies; 5+ messages in thread
From: Maxime Gouin @ 2022-01-05 10:32 UTC (permalink / raw)
  To: dev; +Cc: Maxime Gouin, Heinrich Kuhn, Alejandro Lucero, Olivier Matz

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-21 14:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 10:32 [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address Maxime Gouin
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

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).