On Tue, Aug 7, 2018 at 2:22 PM, Wei Wang 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
On Tue, Aug 7, 2018 at 2:22 PM, Wei Wang 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
On 08/07/2018 06:26 PM, Andy Shevchenko wrote:
Probably it's more clear to post the entire function here for a discussion:
int __bitmap_weight(const unsigned long *bitmap, unsigned int bits)
{
unsigned int k, lim = bits/BITS_PER_LONG;
int w = 0;
for (k = 0; k < lim;
On 08/07/2018 06:26 PM, Andy Shevchenko wrote:
Probably it's more clear to post the entire function here for a discussion:
int __bitmap_weight(const unsigned long *bitmap, unsigned int bits)
{
unsigned int k, lim = bits/BITS_PER_LONG;
int w = 0;
for (k = 0; k < lim;
On Tue, Aug 7, 2018 at 10:03 AM, Wei Wang wrote:
> On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
>> On 2018-07-26 12:15, Wei Wang wrote:
>>> if (bits % BITS_PER_LONG)
>>> w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
>>>
>>> we could remove the "if" check by "w +=
On Tue, Aug 7, 2018 at 10:03 AM, Wei Wang wrote:
> On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
>> On 2018-07-26 12:15, Wei Wang wrote:
>>> if (bits % BITS_PER_LONG)
>>> w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
>>>
>>> we could remove the "if" check by "w +=
On 08/07/2018 03:03 PM, Wei Wang wrote:
On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
On 2018-07-26 12:15, Wei Wang wrote:
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if
On 08/07/2018 03:03 PM, Wei Wang wrote:
On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
On 2018-07-26 12:15, Wei Wang wrote:
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if
On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
On 2018-07-26 12:15, Wei Wang wrote:
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to
On 08/07/2018 07:30 AM, Rasmus Villemoes wrote:
On 2018-07-26 12:15, Wei Wang wrote:
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to
On 2018-07-26 12:15, Wei Wang wrote:
> On 07/26/2018 05:37 PM, Yury Norov wrote:
>> On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
>>> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
>>> 0. This patch changes the macro to return 0 when there is no bit
>>> needs
On 2018-07-26 12:15, Wei Wang wrote:
> On 07/26/2018 05:37 PM, Yury Norov wrote:
>> On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
>>> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
>>> 0. This patch changes the macro to return 0 when there is no bit
>>> needs
On 07/26/2018 08:10 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 06:15:59PM +0800, Wei Wang wrote:
External Email
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0.
On 07/26/2018 08:10 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 06:15:59PM +0800, Wei Wang wrote:
External Email
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0.
On Thu, Jul 26, 2018 at 1:08 PM, Wei Wang wrote:
> On 07/26/2018 04:48 PM, Andy Shevchenko wrote:
>>
>> On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
>>>
>>> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
>>> 0. This patch changes the macro to return 0 when there is
On Thu, Jul 26, 2018 at 1:08 PM, Wei Wang wrote:
> On 07/26/2018 04:48 PM, Andy Shevchenko wrote:
>>
>> On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
>>>
>>> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
>>> 0. This patch changes the macro to return 0 when there is
On Thu, Jul 26, 2018 at 06:15:59PM +0800, Wei Wang wrote:
> External Email
>
> On 07/26/2018 05:37 PM, Yury Norov wrote:
> > On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
> > > The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
> > > 0. This patch changes the
On Thu, Jul 26, 2018 at 06:15:59PM +0800, Wei Wang wrote:
> External Email
>
> On 07/26/2018 05:37 PM, Yury Norov wrote:
> > On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
> > > The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
> > > 0. This patch changes the
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to return 0 when there is no bit needs to
be masked.
I think this is intentional behavour.
On 07/26/2018 05:37 PM, Yury Norov wrote:
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to return 0 when there is no bit needs to
be masked.
I think this is intentional behavour.
On 07/26/2018 04:48 PM, Andy Shevchenko wrote:
On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x 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
On 07/26/2018 04:48 PM, Andy Shevchenko wrote:
On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
The existing BITMAP_LAST_WORD_MASK macro returns 0x 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
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
> 0. This patch changes the macro to return 0 when there is no bit needs to
> be masked.
I think this is intentional behavour. Previous version did return ~0UL
On Thu, Jul 26, 2018 at 04:07:51PM +0800, Wei Wang wrote:
> The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
> 0. This patch changes the macro to return 0 when there is no bit needs to
> be masked.
I think this is intentional behavour. Previous version did return ~0UL
On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
> The existing BITMAP_LAST_WORD_MASK macro returns 0x 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
On Thu, Jul 26, 2018 at 11:07 AM, Wei Wang wrote:
> The existing BITMAP_LAST_WORD_MASK macro returns 0x 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
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to return 0 when there is no bit needs to
be masked.
Signed-off-by: Wei Wang
Cc: Andrew Morton
Cc: Rasmus Villemoes
Cc: Yury Norov
---
include/linux/bitmap.h | 5 -
1 file changed, 4
The existing BITMAP_LAST_WORD_MASK macro returns 0x if nbits is
0. This patch changes the macro to return 0 when there is no bit needs to
be masked.
Signed-off-by: Wei Wang
Cc: Andrew Morton
Cc: Rasmus Villemoes
Cc: Yury Norov
---
include/linux/bitmap.h | 5 -
1 file changed, 4
28 matches
Mail list logo