]> git.ipfire.org Git - thirdparty/linux.git/commit - lib/bitmap.c
lib/bitmap.c: simplify bitmap_ord_to_pos
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 12 Feb 2015 23:02:10 +0000 (15:02 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Feb 2015 02:54:14 +0000 (18:54 -0800)
commitf6a1f5db8d7a7a94ff07251996959d27daba4ee7
tree60e8d219664966cab66732850ac0e40f9aa5dc5e
parentdf1d80a9eb16d98002673f68a7ebbe881f6e6946
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>
include/linux/bitmap.h
lib/bitmap.c