]> git.baikalelectronics.ru Git - kernel.git/commit
infiniband: mlx5: avoid a compile-time warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 Jan 2015 16:09:43 +0000 (17:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Jan 2015 22:08:21 +0000 (17:08 -0500)
commit8b7a80786d6f4feecef21c52dad0df72dccddcd5
tree73a147905cf75c7cf2c60be1f0d0f84906f58671
parent3801730bb68fb420c4653704d4fcb59c9c843229
infiniband: mlx5: avoid a compile-time warning

The return type of find_first_bit() is architecture specific,
on ARM it is 'unsigned int', while the asm-generic code used
on x86 and a lot of other architectures returns 'unsigned long'.

When building the mlx5 driver on ARM, we get a warning about
this:

infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages':
infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast
     m = min(m, find_first_bit(&tmp, sizeof(tmp)));

This patch changes the driver to use min_t to make it behave
the same way on all architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/mlx5/mem.c