Re: [PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-14 Thread Rakib Mullick
On Tue, Nov 14, 2017 at 1:23 PM, Rasmus Villemoes wrote: > > hint: sizeof() very rarely evaluates to zero... So this is the same as > "is32 = 1". So the patch as-is is broken (and may explain the 1-byte > delta in vmlinux). But even if this condition is fixed, the patch

Re: [PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-14 Thread Rakib Mullick
On Tue, Nov 14, 2017 at 1:23 PM, Rasmus Villemoes wrote: > > hint: sizeof() very rarely evaluates to zero... So this is the same as > "is32 = 1". So the patch as-is is broken (and may explain the 1-byte > delta in vmlinux). But even if this condition is fixed, the patch > doesn't change anything,

Re: [PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-13 Thread Rasmus Villemoes
On 14 November 2017 at 07:57, Rakib Mullick wrote: > Currently, during __bitmap_weight() calculation hweight_long() is used. > Inside a hweight_long() a check has been made to figure out whether a > hweight32() or hweight64() version to use. > > diff --git a/lib/bitmap.c

Re: [PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-13 Thread Rasmus Villemoes
On 14 November 2017 at 07:57, Rakib Mullick wrote: > Currently, during __bitmap_weight() calculation hweight_long() is used. > Inside a hweight_long() a check has been made to figure out whether a > hweight32() or hweight64() version to use. > > diff --git a/lib/bitmap.c b/lib/bitmap.c > index

[PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-13 Thread Rakib Mullick
Currently, during __bitmap_weight() calculation hweight_long() is used. Inside a hweight_long() a check has been made to figure out whether a hweight32() or hweight64() version to use. However, it's unnecessary to do it in case of __bitmap_weight() calculation inside the loop. We can detect

[PATCH] lib: Avoid redundant sizeof checking in __bitmap_weight() calculation.

2017-11-13 Thread Rakib Mullick
Currently, during __bitmap_weight() calculation hweight_long() is used. Inside a hweight_long() a check has been made to figure out whether a hweight32() or hweight64() version to use. However, it's unnecessary to do it in case of __bitmap_weight() calculation inside the loop. We can detect