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 3663FA0350; Fri, 8 May 2020 18:46:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3E101DA8B; Fri, 8 May 2020 18:45:56 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 526471DA7B for ; Fri, 8 May 2020 18:45:55 +0200 (CEST) IronPort-SDR: 7uqUK1cRa9a321V8iTY9NBlVI2OJML/GTcW4V3WAgBb/36qCMQkImlhYyotJyX57asKkY4sPmT aCA2ETQ1ckjw== 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:54 -0700 IronPort-SDR: T5qut8+27WmfIFETE8sapqN/LFv0DJLSO3YYAgM4NCAGsoTcS1oYa5N20Uj9jBKCR8sRT20Z5m stn6HQGA8AsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637744" 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:53 -0700 From: Ferruh Yigit To: Jerin Jacob , Nithin Dabilpuram Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand Date: Fri, 8 May 2020 17:45:44 +0100 Message-Id: <20200508164546.2489396-2-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 2/4] mempool/octeontx2: fix build for gcc 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: In file included from .../drivers/mempool/octeontx2/otx2_mempool.h:13, from .../drivers/mempool/octeontx2/otx2_mempool_ops.c:8: .../drivers/mempool/octeontx2/otx2_mempool_ops.c: In function ‘otx2_npa_alloc’: .../drivers/common/octeontx2/otx2_common.h:94:2: error: ‘aura_handle’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 94 | rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem, \ | ^~~~~~~ .../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11: note: ‘aura_handle’ was declared here 643 | uint64_t aura_handle; | ^~~~~~~~~~~ This looks like false positive, assigning an initial value to 'aura_handle' to fix the build error. Signed-off-by: Ferruh Yigit --- This is assuming assigning initial value won't have a performance affect if it does, we need to find another fix. And overall not sure why this false positive warning is generated. --- drivers/mempool/octeontx2/otx2_mempool_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c index 162b7f01da..078ffac3e2 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -640,7 +640,7 @@ otx2_npa_alloc(struct rte_mempool *mp) struct otx2_npa_lf *lf; struct npa_aura_s aura; struct npa_pool_s pool; - uint64_t aura_handle; + uint64_t aura_handle = 0; size_t padding; int rc; -- 2.25.4