DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Marcin Wojtas <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Guy Tzalik <gtzalik@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Igor Chauskin <igorch@amazon.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	David Marchand <david.marchand@redhat.com>
Subject: [dpdk-dev] [PATCH 3/3] net/ena: fix build for O1 optimization
Date: Thu,  7 May 2020 13:02:59 +0100	[thread overview]
Message-ID: <20200507120259.2197813-3-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20200507120259.2197813-1-ferruh.yigit@intel.com>

Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

Build error:
.../drivers/net/ena/ena_ethdev.c: In function ‘eth_ena_dev_init’:
.../drivers/net/ena/ena_ethdev.c:1815:20:
    error: ‘wd_state’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
 1815 |  adapter->wd_state = wd_state;
      |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This looks like false positive, fixing by assigning initial value to
'wd_state' variable.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/ena/ena_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index c3fd3a4ac0..fbddc79f79 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1756,7 +1756,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	int rc;
 	static int adapters_found;
 	bool disable_meta_caching;
-	bool wd_state;
+	bool wd_state = false;
 
 	eth_dev->dev_ops = &ena_dev_ops;
 	eth_dev->rx_pkt_burst = &eth_ena_recv_pkts;
-- 
2.25.4


  parent reply	other threads:[~2020-05-07 12:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 12:02 [dpdk-dev] [PATCH 1/3] ring: fix build for gcc " Ferruh Yigit
2020-05-07 12:02 ` [dpdk-dev] [PATCH 2/3] mempool/octeontx2: " Ferruh Yigit
2020-05-07 14:05   ` Ananyev, Konstantin
2020-05-08 16:20     ` Ferruh Yigit
2020-05-08 16:39       ` Ferruh Yigit
2020-05-07 12:02 ` Ferruh Yigit [this message]
2020-05-08 13:59   ` [dpdk-dev] [PATCH 3/3] net/ena: fix build for " Michał Krawczyk
2020-05-07 13:47 ` [dpdk-dev] [PATCH 1/3] ring: fix build for gcc " Ananyev, Konstantin
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 1/4] " Ferruh Yigit
2020-05-08 16:45   ` [dpdk-dev] [PATCH v2 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-10 11:51     ` Jerin Jacob
2020-05-08 16:45   ` [dpdk-dev] [PATCH v2 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-08 16:45   ` [dpdk-dev] [PATCH v2 4/4] event/octeontx2: " Ferruh Yigit
2020-05-08 17:22     ` Ananyev, Konstantin
2020-05-10 11:53       ` Jerin Jacob
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Ferruh Yigit
2020-05-11 16:07   ` [dpdk-dev] [PATCH v3 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-11 16:07   ` [dpdk-dev] [PATCH v3 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-11 16:07   ` [dpdk-dev] [PATCH v3 4/4] event/octeontx2: " Ferruh Yigit
2020-05-11 19:13   ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Thomas Monjalon

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=20200507120259.2197813-3-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=igorch@amazon.com \
    --cc=mk@semihalf.com \
    --cc=mw@semihalf.com \
    --cc=thomas@monjalon.net \
    /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).