From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15190A051C; Tue, 11 Feb 2020 10:37:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A06E2BF4; Tue, 11 Feb 2020 10:37:40 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 77C102BD3 for ; Tue, 11 Feb 2020 10:37:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 01:37:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="347246363" Received: from intel.sh.intel.com ([10.239.255.133]) by fmsmga001.fm.intel.com with ESMTP; 11 Feb 2020 01:37:36 -0800 From: Shougang Wang To: dev@dpdk.org Cc: qiming.yang@intel.com, xiaolong.ye@intel.com, Shougang Wang Date: Tue, 11 Feb 2020 09:26:22 +0000 Message-Id: <20200211092622.20667-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200211071359.17085-1-shougangx.wang@intel.com> References: <20200211071359.17085-1-shougangx.wang@intel.com> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix coverity issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes (Logically dead code ) coverity issue. Coverity issue: 353624 Fixes: ba7b12dd64e4 ("net/ixgbe: fix link up in FreeBSD") Signed-off-by: Shougang Wang --- drivers/net/ixgbe/ixgbe_ethdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7ea1962f6..2a248a3f2 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -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 */ -- 2.17.1