Re: [PATCH] IB/mlx5: Fix a parameter of find_first_bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 26, 2016 at 07:16:17AM +0200, Christophe JAILLET wrote:
> 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@xxxxxxxxxx>

Thanks,
Acked-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux