]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: avoid a -Wmaybe-uninitialize warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Oct 2016 16:16:20 +0000 (18:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Oct 2016 18:53:48 +0000 (14:53 -0400)
commit113e80a88431bc644af5f28d9f214f6c5a1e8a14
tree1b58dfbb740c7538f51aeb9a1bab1aba8f5e5198
parent97048225dce46415c8a2dd6c55999dea29917578
IB/mlx4: avoid a -Wmaybe-uninitialize warning

There is an old warning about mlx4_SW2HW_EQ_wrapper on x86:

ethernet/mellanox/mlx4/resource_tracker.c: In function ‘mlx4_SW2HW_EQ_wrapper’:
ethernet/mellanox/mlx4/resource_tracker.c:3071:10: error: ‘eq’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

The problem here is that gcc won't track the state of the variable
across a spin_unlock. Moving the assignment out of the lock is
safe here and avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c