mempool/octeontx2: fix build for gcc O1 optimization
authorFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 16:07:23 +0000 (17:07 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 11 May 2020 17:21:18 +0000 (19:21 +0200)
commit0403b233ee4fd4857808fcc811054bc9109feb97
tree1a9e6ef5d0dff12984b294442f2dafdbd745b2ff
parent867b49d17ac76ac202c307b700c0303ca815300d
mempool/octeontx2: fix build for gcc O1 optimization

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 <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/mempool/octeontx2/otx2_mempool_ops.c