Re: [PATCH v2] lib/memweight.c: open codes bitmap_weight()

2019-08-24 Thread Matthew Wilcox
On Sat, Aug 24, 2019 at 01:01:02PM +0300, Denis Efremov wrote: > This patch open codes the bitmap_weight() call. The direct > invocation of hweight_long() allows to remove the BUG_ON and > excessive "longs to bits, bits to longs" conversion. Honestly, that's not the problem with this function. Ta

[PATCH v2] lib/memweight.c: open codes bitmap_weight()

2019-08-24 Thread Denis Efremov
This patch open codes the bitmap_weight() call. The direct invocation of hweight_long() allows to remove the BUG_ON and excessive "longs to bits, bits to longs" conversion. BUG_ON was required to check that bitmap_weight() will return a correct value, i.e. the computed weight will fit the int type