[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160826193304.GH594@leon.nu>
Date: Fri, 26 Aug 2016 22:33:04 +0300
From: Leon Romanovsky <leonro@...lanox.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: matanb@...lanox.com, dledford@...hat.com, sean.hefty@...el.com,
hal.rosenstock@...il.com, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] IB/mlx5: Fix a parameter of find_first_bit
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@...adoo.fr>
Thanks,
Acked-by: Leon Romanovsky <leonro@...lanox.com>
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists