aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-03-23 19:42:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-23 22:46:21 -0400
commit3fca5af7860f87eb2cd706c2d7dda4ad03230a07 (patch)
treef89b0df7317c250ccd6998fa2b1fa2f91ade4353 /arch/m68k
parentf312eff8164879e04923d41e9dd23e7850937d85 (diff)
m68k: remove inline asm from minix_find_first_zero_bit
As a preparation for moving minix bit operations from asm/bitops.h to architecture independent code in minix filesystem, this removes inline asm from minix_find_first_zero_bit() for m68k. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Andreas Schwab <schwab@linux-m68k.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_mm.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 3d16871402ad..a403b5e69aab 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -330,23 +330,19 @@ static inline int __fls(int x)
330static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size) 330static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
331{ 331{
332 const unsigned short *p = vaddr, *addr = vaddr; 332 const unsigned short *p = vaddr, *addr = vaddr;
333 int res;
334 unsigned short num; 333 unsigned short num;
335 334
336 if (!size) 335 if (!size)
337 return 0; 336 return 0;
338 337
339 size = (size >> 4) + ((size & 15) > 0); 338 size = (size >> 4) + ((size & 15) > 0);
340 while (*p++ == 0xffff) 339 while (*p++ == 0xffff) {
341 {
342 if (--size == 0) 340 if (--size == 0)
343 return (p - addr) << 4; 341 return (p - addr) << 4;
344 } 342 }
345 343
346 num = ~*--p; 344 num = *--p;
347 __asm__ __volatile__ ("bfffo %1{#16,#16},%0" 345 return ((p - addr) << 4) + ffz(num);
348 : "=d" (res) : "d" (num & -num));
349 return ((p - addr) << 4) + (res ^ 31);
350} 346}
351 347
352#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr)) 348#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))