IB/mlx5: Fix the size parameter to find_first_bit
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Fri, 26 Aug 2016 05:16:17 +0000 (07:16 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 2 Sep 2016 17:46:12 +0000 (13:46 -0400)
commitfffd68734dc685e208e86d8c5f6522cd695a8d60
tree723bac04af6853bbbde4c544afa5b4cfc32b5ba5
parent61a28d2b690a8b6c383a075a12d62d711850f9d7
IB/mlx5: Fix the size parameter to find_first_bit

The 2nd parameter of 'find_first_bit' is the number of bits to search.
In this case, we are passing 'sizeof(tmp)' which is likely to be 4 or 8
because 'tmp' is an 'unsigned long'.

It is likely that the number of bits of 'tmp' was expected here. So use
BITS_PER_LONG instead.

It has been spotted by the following coccinelle script:
@@
expression ret, x;

@@
*  ret = \(find_first_bit \| find_first_zero_bit\) (x, sizeof(...));

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Majd Dibbiny <majd@mellanox.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/mem.c