net/ena: fix build for O1 optimization
authorFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 16:07:24 +0000 (17:07 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 11 May 2020 17:21:31 +0000 (19:21 +0200)
commit5f267cb01b41def2af37b8fa56828e75ae91add0
treeb8608ff5b4afb96cecef590e88d6b48cc79ca404
parent0403b233ee4fd4857808fcc811054bc9109feb97
net/ena: fix build for 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:
.../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 <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
drivers/net/ena/ena_ethdev.c