From: Maxime Gouin Date: Wed, 5 Jan 2022 10:32:02 +0000 (+0100) Subject: net/nfp: remove duplicated check when setting MAC address X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9e2cf57e2969a7248c1dbfb2e0c6d5c185b8addf;p=dpdk.git net/nfp: remove duplicated check when setting MAC address 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") Cc: stable@dpdk.org Signed-off-by: Maxime Gouin Reviewed-by: Olivier Matz Acked-by: Kevin Traynor Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index f8978e803a..b26770dbfb 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);