infiniband: mlx5: avoid a compile-time warning
commitc4a1b5dd7b57c550b8bfd11d4229097eb824532a
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 Jan 2015 16:09:43 +0000 (13 17:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 May 2017 05:44:11 +0000 (8 07:44 +0200)
tree8d1fa222b585c516d7e7f0d5d3829b00d4661278
parent66f6aa52894a980b5e3e622bdd8691f5d4fcd8b9
infiniband: mlx5: avoid a compile-time warning

commit 7835bfb5261501590a508b3de3379e2231cb4853 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx5/mem.c