include/linux/bitmap.h: make bitmap_fill() and bitmap_zero() consistent
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 6 Feb 2018 23:38:20 +0000 (15:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 02:32:44 +0000 (18:32 -0800)
commit334cfa48d38f5416c125a71a57f72d6cf634d797
treefee2a87aa695e98d29fe0043b58525101a860c2f
parentfe81814c3e091adde489e9d7ac1179340845e396
include/linux/bitmap.h: make bitmap_fill() and bitmap_zero() consistent

Behaviour of bitmap_fill() differs from bitmap_zero() in a way how bits
behind bitmap are handed.  bitmap_zero() clears entire bitmap by unsigned
long boundary, while bitmap_fill() mimics bitmap_set().

Here we change bitmap_fill() behaviour to be consistent with bitmap_zero()
and add a note to documentation.

The change might reveal some bugs in the code where unused bits are
handled differently and in such cases bitmap_set() has to be used.

Link: http://lkml.kernel.org/r/20180109172430.87452-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/bitmap.h