]> git.baikalelectronics.ru Git - kernel.git/commit
net: sfc: avoid -Wtype-limits warning
authorArnd Bergmann <arnd@arndb.de>
Wed, 15 Jun 2016 20:31:10 +0000 (22:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jun 2016 21:24:06 +0000 (14:24 -0700)
commit0c29585aff99d8fc67d5ebed536b61defb05454f
tree9335bac4f81405c90f41c0ffd6f02969a8a5f21a
parent649d1facfa624528f61dbeb7286f506238f7d9bd
net: sfc: avoid -Wtype-limits warning

When building with -Wextra, we get a harmless warning from the
EFX_EXTRACT_OWORD32 macro:

ethernet/sfc/farch.c: In function 'efx_farch_test_registers':
ethernet/sfc/farch.c:119:30: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
ethernet/sfc/farch.c:124:144: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
ethernet/sfc/farch.c:124:392: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
ethernet/sfc/farch.c:124:731: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]

The macro and the caller are both correct, but we can avoid the
warning by changing the index variable to a signed type.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/farch.c