From 0403b233ee4fd4857808fcc811054bc9109feb97 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Mon, 11 May 2020 17:07:23 +0100 Subject: [PATCH] mempool/octeontx2: fix build for gcc O1 optimization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Jerin Jacob --- 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..a14c9c5e94 100644 --- a/drivers/mempool/octeontx2/otx2_mempool_ops.c +++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c @@ -637,10 +637,10 @@ static int otx2_npa_alloc(struct rte_mempool *mp) { uint32_t block_size, block_count; + uint64_t aura_handle = 0; struct otx2_npa_lf *lf; struct npa_aura_s aura; struct npa_pool_s pool; - uint64_t aura_handle; size_t padding; int rc; -- 2.20.1