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 0F73BA051C; Tue, 11 Feb 2020 09:28:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 268B62BE9; Tue, 11 Feb 2020 09:28:29 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 911802BD5 for ; Tue, 11 Feb 2020 09:28:26 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 00:28:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="405870858" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga005.jf.intel.com with ESMTP; 11 Feb 2020 00:28:24 -0800 Date: Tue, 11 Feb 2020 16:27:08 +0800 From: Ye Xiaolong To: Shougang Wang Cc: dev@dpdk.org, qiming.yang@intel.com Message-ID: <20200211082708.GK80720@intel.com> References: <20200211071359.17085-1-shougangx.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211071359.17085-1-shougangx.wang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [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" On 02/11, Shougang Wang wrote: >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++) { Better to keep the constant nb_iter instead of using magic number. > 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); > } >+ Unrelated change. Thanks, Xiaolong > return 0; >+#else >+ RTE_SET_USED(hw); >+ return 0; >+#endif > } > > /* return 0 means link status changed, -1 means not changed */ >-- >2.17.1 >