From patchwork Tue Feb 11 07:13:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shougang Wang X-Patchwork-Id: 65720 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3057A051C; Tue, 11 Feb 2020 08:19:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F164D1F28; Tue, 11 Feb 2020 08:19:10 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 6FBD12B89 for ; Tue, 11 Feb 2020 08:19:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2020 23:19:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,427,1574150400"; d="scan'208";a="266151871" Received: from intel.sh.intel.com ([10.239.255.133]) by fmsmga002.fm.intel.com with ESMTP; 10 Feb 2020 23:19:06 -0800 From: Shougang Wang To: dev@dpdk.org Cc: qiming.yang@intel.com, xiaolong.ye@intel.com, Shougang Wang Date: Tue, 11 Feb 2020 07:13:59 +0000 Message-Id: <20200211071359.17085-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7ea1962f6..b19f47f50 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4128,15 +4128,11 @@ 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; - for (i = 0; i < nb_iter; i++) { + for (i = 0; i < 25; i++) { err = ixgbe_check_link(hw, &speed, &link_up, 0); if (err) return err; @@ -4144,7 +4140,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 */