DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shougang Wang <shougangx.wang@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, xiaolong.ye@intel.com,
	Shougang Wang <shougangx.wang@intel.com>
Subject: [dpdk-dev] [PATCH] net/ixgbe: fix coverity issue
Date: Tue, 11 Feb 2020 07:13:59 +0000	[thread overview]
Message-ID: <20200211071359.17085-1-shougangx.wang@intel.com> (raw)

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 <shougangx.wang@intel.com>
---
 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 */
-- 
2.17.1


             reply	other threads:[~2020-02-11  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  7:13 Shougang Wang [this message]
2020-02-11  8:27 ` Ye Xiaolong
2020-02-11  9:26 ` [dpdk-dev] [PATCH v2] " Shougang Wang
2020-02-11 11:49   ` Ye Xiaolong
  -- strict thread matches above, loose matches on Subject: below --
2020-02-10  4:15 [dpdk-dev] [PATCH] " Guinan Sun
2020-02-10  6:57 ` Ye Xiaolong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211071359.17085-1-shougangx.wang@intel.com \
    --to=shougangx.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).