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 5F06FA0350; Fri, 8 May 2020 18:46:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8FA421DAAB; Fri, 8 May 2020 18:45:59 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id CA9341DAAB for ; Fri, 8 May 2020 18:45:58 +0200 (CEST) IronPort-SDR: s2//2sTtxQMiei2G9tOlcrVe/CSflPjWSBS7o4G4WwnRgUR3qhJi1iGme1n9ciPmvBvTJPHiOd dHP1oX3Kgjfg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:45:58 -0700 IronPort-SDR: XvS+V/NigL/Pakj5Fb/EniGmO+zZYPFcS6TZC4sp6muu9SP9OtPtI/21sn5M4jbFoYuId/ENbE WUC/mO5jaEYA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637758" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:56 -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: Fri, 8 May 2020 17:45:45 +0100 Message-Id: <20200508164546.2489396-3-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200508164546.2489396-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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