[v3,10/19] net/octeon_ep: remove duplicate code
Checks
Commit Message
Both sides of the if in uninit are using same code.
Link: https://pvs-studio.com/en/blog/posts/cpp/1183/
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/octeon_ep/otx_ep_ethdev.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
@@ -721,14 +721,9 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = {
static int
otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev)
{
- if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- eth_dev->dev_ops = NULL;
- eth_dev->rx_pkt_burst = NULL;
- eth_dev->tx_pkt_burst = NULL;
- return 0;
- }
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ otx_ep_mbox_uninit(eth_dev);
- otx_ep_mbox_uninit(eth_dev);
eth_dev->dev_ops = NULL;
eth_dev->rx_pkt_burst = NULL;
eth_dev->tx_pkt_burst = NULL;