From: Wei Wang <wei.w.wang@intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.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 18:08:55 +0800 [thread overview]
Message-ID: <5B599DB7.4050700@intel.com> (raw)
In-Reply-To: <CAHp75VcFZ7jS-M6+O95XTfyg1m05UOQMVgdQb5wC-0bNWkyvMg@mail.gmail.com>
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. 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.
Best,
Wei
next prev parent reply other threads:[~2018-07-26 10:04 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 [this message]
2018-07-26 14:00 ` Andy Shevchenko
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=5B599DB7.4050700@intel.com \
--to=wei.w.wang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andy.shevchenko@gmail.com \
--cc=corbet@lwn.net \
--cc=dgilbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mawilcox@microsoft.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