From 7d7c7b24e416afb2637be8447e03ca4457c100fd Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 23 Sep 2013 12:01:44 +0200 Subject: s390/bitops: rename find_first_bit_left() to find_first_bit_inv() find_first_bit_left() and friends have nothing to do with the normal LSB0 bit numbering for big endian machines used in Linux (least significant bit has bit number 0). Instead they use MSB0 bit numbering, where the most signficant bit has bit number 0. So rename find_first_bit_left() and friends to find_first_bit_inv(), to avoid any confusion. Also provide inv versions of set_bit, clear_bit and test_bit. This also removes the confusing use of e.g. set_bit() in airq.c which uses a "be_to_le" bit number conversion, which could imply that instead set_bit_le() could be used. But that is entirely wrong since the _le bitops variant uses yet another bit numbering scheme. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/lib/find.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch/s390/lib') diff --git a/arch/s390/lib/find.c b/arch/s390/lib/find.c index 8963929b06b9..620d34d6487e 100644 --- a/arch/s390/lib/find.c +++ b/arch/s390/lib/find.c @@ -15,7 +15,7 @@ #include #include -unsigned long find_first_bit_left(const unsigned long *addr, unsigned long size) +unsigned long find_first_bit_inv(const unsigned long *addr, unsigned long size) { const unsigned long *p = addr; unsigned long result = 0; @@ -35,10 +35,10 @@ unsigned long find_first_bit_left(const unsigned long *addr, unsigned long size) found: return result + (__fls(tmp) ^ (BITS_PER_LONG - 1)); } -EXPORT_SYMBOL(find_first_bit_left); +EXPORT_SYMBOL(find_first_bit_inv); -unsigned long find_next_bit_left(const unsigned long *addr, unsigned long size, - unsigned long offset) +unsigned long find_next_bit_inv(const unsigned long *addr, unsigned long size, + unsigned long offset) { const unsigned long *p = addr + (offset / BITS_PER_LONG); unsigned long result = offset & ~(BITS_PER_LONG - 1); @@ -74,4 +74,4 @@ found_first: found_middle: return result + (__fls(tmp) ^ (BITS_PER_LONG - 1)); } -EXPORT_SYMBOL(find_next_bit_left); +EXPORT_SYMBOL(find_next_bit_inv); -- cgit v1.2.3