[dpdk-stable] [PATCH 04/24] net/hns3: remove unnecessary branch

Wei Hu (Xavier) huwei013 at chinasoftinc.com
Mon Aug 17 11:25:12 CEST 2020


From: Lijun Ou <oulijun at huawei.com>

[ upstream commit d13a7447a131a3a7078caf1d14e674e8add1d0a5 ]

Because the rte layer of DPDK framework has already processed the case
when the idx is zero before calling the '.mac_addr_remove' ops function,
the input parameter named idx can not be zero in the '.mac_addr_remove'
function. This patch removes unnecessary branch process to check whether
input parameter named idx is zero in the '.mac_addr_remove' ops
implementation function named hns3_remove_mac_addr.

Signed-off-by: Lijun Ou <oulijun at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index c31a9328a..128cd793d 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1531,8 +1531,6 @@ hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
 		return;
 	}
 
-	if (idx == 0)
-		hw->mac.default_addr_setted = false;
 	rte_spinlock_unlock(&hw->lock);
 }
 
-- 
2.27.0



More information about the stable mailing list