net/ixgbe: remove dead code
authorShougang Wang <shougangx.wang@intel.com>
Tue, 11 Feb 2020 09:26:22 +0000 (09:26 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 14 Feb 2020 11:42:12 +0000 (12:42 +0100)
This patch fixes (Logically dead code) coverity issue.

Coverity issue: 353624
Fixes: ba7b12dd64e4 ("net/ixgbe: fix link up in FreeBSD")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index 7ea1962..2a248a3 100644 (file)
@@ -4128,13 +4128,10 @@ static int
 ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
 {
 #ifdef RTE_EXEC_ENV_FREEBSD
-       const int nb_iter = 25;
-#else
-       const int nb_iter = 0;
-#endif
        int err, i;
        bool link_up = false;
        uint32_t speed = 0;
+       const int nb_iter = 25;
 
        for (i = 0; i < nb_iter; i++) {
                err = ixgbe_check_link(hw, &speed, &link_up, 0);
@@ -4144,7 +4141,12 @@ ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
                        return 0;
                msec_delay(200);
        }
+
+       return 0;
+#else
+       RTE_SET_USED(hw);
        return 0;
+#endif
 }
 
 /* return 0 means link status changed, -1 means not changed */