diff options
| author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-02-12 15:02:10 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:59:34 +0200 |
| commit | 799178a2caae13058f8571aab35ad36d18555435 (patch) | |
| tree | f9737bdabddebe2d16b516d5a3b31ebc0f813ab2 /include | |
| parent | 9a2bec6ca842b0a195625e2799cc796309955e06 (diff) | |
lib/bitmap.c: simplify bitmap_ord_to_pos
Make the return value and the ord and nbits parameters of
bitmap_ord_to_pos unsigned.
Also, simplify the implementation and as a side effect make the result
fully defined, returning nbits for ord >= weight, in analogy with what
find_{first,next}_bit does. This is a better sentinel than the former
("unofficial") 0. No current users are affected by this change.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/bitmap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 2a2afb3d5..4aa3eaabd 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -158,7 +158,7 @@ extern int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int extern void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order); extern int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order); extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); -extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits); +extern unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits); #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) #define BITMAP_LAST_WORD_MASK(nbits) \ |
