From: Leon Romanovsky <leonro@mellanox.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: matanb@mellanox.com, dledford@redhat.com, sean.hefty@intel.com,
hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] IB/mlx5: Fix a parameter of find_first_bit
Date: Fri, 26 Aug 2016 22:33:04 +0300 [thread overview]
Message-ID: <20160826193304.GH594@leon.nu> (raw)
In-Reply-To: <1472188577-14550-1-git-send-email-christophe.jaillet@wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 646 bytes --]
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@wanadoo.fr>
Thanks,
Acked-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-08-26 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 5:16 [PATCH] IB/mlx5: Fix a parameter of find_first_bit Christophe JAILLET
2016-08-26 9:52 ` Majd Dibbiny
2016-08-26 19:33 ` Leon Romanovsky [this message]
2016-09-02 17:12 ` Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160826193304.GH594@leon.nu \
--to=leonro@mellanox.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=matanb@mellanox.com \
--cc=sean.hefty@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox