rocker: fix maybe-uninitialized warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Oct 2016 22:16:15 +0000 (00:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Oct 2016 18:20:36 +0000 (14:20 -0400)
commitecf244f753e09486707843f2b7b1874f33027038
tree1409bb1b4d68699c9bf35575a0e4f70652bbc456
parent52ccd6318481a467d8ad54ea40f60c61e957d58f
rocker: fix maybe-uninitialized warning

In some rare configurations, we get a warning about the 'index' variable
being used without an initialization:

drivers/net/ethernet/rocker/rocker_ofdpa.c: In function ‘ofdpa_port_fib_ipv4.isra.16.constprop’:
drivers/net/ethernet/rocker/rocker_ofdpa.c:2425:92: warning: ‘index’ may be used uninitialized in this function [-Wmaybe-uninitialized]

This is a false positive, the logic is just a bit too complex for gcc
to follow here. Moving the intialization of 'index' a little further
down makes it clear to gcc that the function always returns an error
if it is not initialized.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker_ofdpa.c