Commit 968d803c authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

m68knommu: use generic find_next_bit_le()

The implementation of find_next_bit_le() on m68knommu is identical with
the generic implementation of find_next_bit_le().
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 802caabb
...@@ -321,50 +321,8 @@ static inline unsigned long find_next_zero_bit_le(void *addr, unsigned long size ...@@ -321,50 +321,8 @@ static inline unsigned long find_next_zero_bit_le(void *addr, unsigned long size
} }
#define find_next_zero_bit_le find_next_zero_bit_le #define find_next_zero_bit_le find_next_zero_bit_le
static inline unsigned long find_next_bit_le(const void *addr, unsigned extern unsigned long find_next_bit_le(const void *addr,
long size, unsigned long offset) unsigned long size, unsigned long offset);
{
const unsigned long *p = addr;
unsigned long result = offset & ~(BITS_PER_LONG - 1);
unsigned long tmp;
if (offset >= size)
return size;
p += offset / BITS_PER_LONG;
size -= result;
offset &= (BITS_PER_LONG - 1UL);
if (offset) {
tmp = __swab32(*(p++));
tmp &= (~0UL << offset);
if (size < BITS_PER_LONG)
goto found_first;
if (tmp)
goto found_middle;
size -= BITS_PER_LONG;
result += BITS_PER_LONG;
}
while (size & ~(BITS_PER_LONG - 1)) {
tmp = *(p++);
if (tmp)
goto found_middle_swap;
result += BITS_PER_LONG;
size -= BITS_PER_LONG;
}
if (!size)
return result;
tmp = __swab32(*p);
found_first:
tmp &= (~0UL >> (BITS_PER_LONG - size));
if (tmp == 0UL) /* Are any bits set? */
return result + size; /* Nope. */
found_middle:
return result + __ffs(tmp);
found_middle_swap:
return result + __ffs(__swab32(tmp));
}
#define find_next_bit_le find_next_bit_le
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment