Re: [PATCH] linux/bitmap.h: fix BITMAP_LAST_WORD_MASK

From: Andy Shevchenko
Date: Tue Aug 14 2018 - 09:28:36 EST


On Tue, Aug 7, 2018 at 2:22 PM, Wei Wang <wei.w.wang@xxxxxxxxx> wrote:
> On 08/07/2018 06:26 PM, Andy Shevchenko wrote:

> "there", I meant that user-space port, not in the kernel.
> e.g.
> Line 225 at https://github.com/qemu/qemu/blob/master/include/qemu/bitmap.h
> (there are a couple of other places)

So, means no problems in Linux kernel project.
Thus -> NAK.

>>> nbits=64, means all the 64 bits need to mask
>>>
>>> The two are different cases, I'm not sure why we let the macro to return
>>> the
>>> same value.
>>
>> The point is macro mustn't be called when nbits==0.

> Yes, I fully agree with that point, but it seems Rasmus NAK-ed that point.

No, we are talking about different things. Rasmus pretty much right
that the caller should have already known nbits and avoid calling this
macro if it's zero.

--
With Best Regards,
Andy Shevchenko