diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-05-26 19:26:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 20:12:39 -0400 |
commit | 968d803c98410910fbadca031b6a873d4bc12dd5 (patch) | |
tree | 656b5b3e4c3eb806244b1d7f34a68ba2275f53ed /arch/m68k | |
parent | 802caabbededeecbe433bcdb8a8ee0721836f7db (diff) |
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: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/include/asm/bitops_no.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h index 52793ebc4471..72e85acdd7bd 100644 --- a/arch/m68k/include/asm/bitops_no.h +++ b/arch/m68k/include/asm/bitops_no.h | |||
@@ -321,50 +321,8 @@ found_middle: | |||
321 | } | 321 | } |
322 | #define find_next_zero_bit_le find_next_zero_bit_le | 322 | #define find_next_zero_bit_le find_next_zero_bit_le |
323 | 323 | ||
324 | static inline unsigned long find_next_bit_le(const void *addr, unsigned | 324 | extern unsigned long find_next_bit_le(const void *addr, |
325 | long size, unsigned long offset) | 325 | unsigned long size, unsigned long offset); |
326 | { | ||
327 | const unsigned long *p = addr; | ||
328 | unsigned long result = offset & ~(BITS_PER_LONG - 1); | ||
329 | unsigned long tmp; | ||
330 | |||
331 | if (offset >= size) | ||
332 | return size; | ||
333 | p += offset / BITS_PER_LONG; | ||
334 | size -= result; | ||
335 | offset &= (BITS_PER_LONG - 1UL); | ||
336 | if (offset) { | ||
337 | tmp = __swab32(*(p++)); | ||
338 | tmp &= (~0UL << offset); | ||
339 | if (size < BITS_PER_LONG) | ||
340 | goto found_first; | ||
341 | if (tmp) | ||
342 | goto found_middle; | ||
343 | size -= BITS_PER_LONG; | ||
344 | result += BITS_PER_LONG; | ||
345 | } | ||
346 | |||
347 | while (size & ~(BITS_PER_LONG - 1)) { | ||
348 | tmp = *(p++); | ||
349 | if (tmp) | ||
350 | goto found_middle_swap; | ||
351 | result += BITS_PER_LONG; | ||
352 | size -= BITS_PER_LONG; | ||
353 | } | ||
354 | if (!size) | ||
355 | return result; | ||
356 | tmp = __swab32(*p); | ||
357 | found_first: | ||
358 | tmp &= (~0UL >> (BITS_PER_LONG - size)); | ||
359 | if (tmp == 0UL) /* Are any bits set? */ | ||
360 | return result + size; /* Nope. */ | ||
361 | found_middle: | ||
362 | return result + __ffs(tmp); | ||
363 | |||
364 | found_middle_swap: | ||
365 | return result + __ffs(__swab32(tmp)); | ||
366 | } | ||
367 | #define find_next_bit_le find_next_bit_le | ||
368 | 326 | ||
369 | #endif /* __KERNEL__ */ | 327 | #endif /* __KERNEL__ */ |
370 | 328 | ||