From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Wei Wang <wei.w.wang@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Yury Norov <ynorov@caviumnetworks.com>,
Jonathan Corbet <corbet@lwn.net>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
dgilbert@redhat.com, Matthew Wilcox <mawilcox@microsoft.com>
Subject: Re: [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK
Date: Thu, 26 Jul 2018 17:00:39 +0300 [thread overview]
Message-ID: <CAHp75VeTN5AmVj5knocsRFssQ9phzCz+jTXLMKoJ9WtasAPJRQ@mail.gmail.com> (raw)
In-Reply-To: <5B599DB7.4050700@intel.com>
On Thu, Jul 26, 2018 at 1:08 PM, Wei Wang <wei.w.wang@intel.com> wrote:
> On 07/26/2018 04:48 PM, Andy Shevchenko wrote:
>>
>> On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang <wei.w.wang@intel.com> wrote:
>>>
>>> The existing BITMAP_LAST_WORD_MASK macro returns 0xffffffff if nbits is
>>> 0. This patch changes the macro to return 0 when there is no bit needs to
>>> be masked.
>>>
>> Can you provide a practical example of what's going wrong before this
>> patch applied?
>>
>
> The reason of making this patch is that I saw some other software which
> ports this function and has possibilities to fall into bugs with usages
> which pass 0 to the macro.
No problems in the kernel, right?
> So I wonder if it would be necessary to make such
> changes in case we would get a similar bug. Or adding something to explain
> that "0" is not applicable to this macro as a reminder to people who would
> use it.
Comment can be added, yes.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2018-07-26 14:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 8:07 [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK Wei Wang
2018-07-26 8:48 ` Andy Shevchenko
2018-07-26 10:08 ` Wei Wang
2018-07-26 14:00 ` Andy Shevchenko [this message]
2018-07-26 9:37 ` Yury Norov
2018-07-26 10:15 ` Wei Wang
2018-07-26 12:10 ` Yury Norov
2018-07-27 2:13 ` Wei Wang
2018-08-06 23:30 ` Rasmus Villemoes
2018-08-07 7:03 ` Wei Wang
2018-08-07 7:15 ` Wei Wang
2018-08-07 10:26 ` Andy Shevchenko
2018-08-07 11:22 ` Wei Wang
2018-08-14 12:46 ` Andy Shevchenko
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=CAHp75VeTN5AmVj5knocsRFssQ9phzCz+jTXLMKoJ9WtasAPJRQ@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=dgilbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mawilcox@microsoft.com \
--cc=wei.w.wang@intel.com \
--cc=ynorov@caviumnetworks.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;
as well as URLs for NNTP newsgroup(s).