]> 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)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Dec 2016 17:12:53 +0000 (12:12 -0500)
commit85720e76051c23b2ec582df8e9a4a98ec3859358
treee4715f11d6423956a78763d08642fd13f0fd747d
parent75b1348d78a5ac35b1b836d23b9340ba64f423c8
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: Doug Ledford <dledford@redhat.com>
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c