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 9F4DBA0350; Mon, 11 May 2020 18:08:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B9AB1C1C0; Mon, 11 May 2020 18:07:50 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0C4241C11E for ; Mon, 11 May 2020 18:07:45 +0200 (CEST) IronPort-SDR: 5eKBj/429e5NxSdiv11YbXkv4PR3x6IYG5FGtIORFEe28/VYUFRsERMwxl1lPXjKEPDaeLUo5s Ef1nYf/kpXxQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 09:07:34 -0700 IronPort-SDR: q/V7E0WF8s7K95KGBFaRjFBv7oj60IjOTqapnzcblWLgMl5maMGTQT9dsc6Db6caJHMAAWDmjN 19jVJ1NmpjJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,380,1583222400"; d="scan'208";a="265201401" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 11 May 2020 09:07:32 -0700 From: Ferruh Yigit To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Igor Chauskin Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Mon, 11 May 2020 17:07:24 +0100 Message-Id: <20200511160725.1497902-3-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200511160725.1497902-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200511160725.1497902-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 3/4] net/ena: fix build for O1 optimization 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" 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 Acked-by: Michal Krawczyk --- 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 = ð_ena_recv_pkts; -- 2.25.4