Skip to content

Commit 17471c7

Browse files
arndbdavem330
authored andcommitted
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>
1 parent 13eab83 commit 17471c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/sfc/farch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ int efx_farch_test_registers(struct efx_nic *efx,
104104
const struct efx_farch_register_test *regs,
105105
size_t n_regs)
106106
{
107-
unsigned address = 0, i, j;
107+
unsigned address = 0;
108+
int i, j;
108109
efx_oword_t mask, imask, original, reg, buf;
109110

110111
for (i = 0; i < n_regs; ++i) {

0 commit comments

Comments
 (0)