DPDK patches and discussions
 help / color / mirror / Atom feed
From: Conor Walsh <conor.walsh@intel.com>
To: jiawenwu@trustnetic.com, jianwang@trustnetic.com
Cc: dev@dpdk.org, linglix.chen@intel.com,
	Conor Walsh <conor.walsh@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/txgbe: return changed to fix gcc compile error
Date: Wed, 11 Nov 2020 15:39:33 +0000	[thread overview]
Message-ID: <20201111153933.1951384-1-conor.walsh@intel.com> (raw)
In-Reply-To: <20201111130542.1949894-1-conor.walsh@intel.com>

When DPDK is compiled with gcc 7.5 with the optimization level set to 1
gcc sees the offset variable in txgbe_ethdev.c as possibly being
uninitialised. To correct this the final return statement in
txgbe_get_offset_by_id was simplified to return -1.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 9f533603a1..f8dffe1f12 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2140,9 +2140,8 @@ txgbe_get_offset_by_id(uint32_t id, uint32_t *offset)
 			nb * (TXGBE_NB_QP_STATS * sizeof(uint64_t));
 		return 0;
 	}
-	id -= TXGBE_NB_QP_STATS * TXGBE_MAX_QP;
 
-	return -(int)(id + 1);
+	return -1;
 }
 
 static int txgbe_dev_xstats_get_names(struct rte_eth_dev *dev,
-- 
2.25.1


  parent reply	other threads:[~2020-11-11 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 13:05 [dpdk-dev] [PATCH v1] net/txgbe: offset needs to be initialised " Conor Walsh
2020-11-11 13:14 ` Ferruh Yigit
2020-11-11 15:39 ` Conor Walsh [this message]
2020-11-12 15:05   ` [dpdk-dev] [PATCH v2] net/txgbe: return changed " Ferruh Yigit

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=20201111153933.1951384-1-conor.walsh@intel.com \
    --to=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianwang@trustnetic.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=linglix.chen@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).