]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
m68k: remove inline asm from minix_find_first_zero_bit
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 23 Mar 2011 23:42:15 +0000 (16:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 02:46:21 +0000 (19:46 -0700)
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>
arch/m68k/include/asm/bitops_mm.h

index 3d16871402adc9c135a12ec59c06967b05496333..a403b5e69aab26c7bb306d9b19a1b74818e1de67 100644 (file)
@@ -330,23 +330,19 @@ static inline int __fls(int x)
 static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
 {
        const unsigned short *p = vaddr, *addr = vaddr;
-       int res;
        unsigned short num;
 
        if (!size)
                return 0;
 
        size = (size >> 4) + ((size & 15) > 0);
-       while (*p++ == 0xffff)
-       {
+       while (*p++ == 0xffff) {
                if (--size == 0)
                        return (p - addr) << 4;
        }
 
-       num = ~*--p;
-       __asm__ __volatile__ ("bfffo %1{#16,#16},%0"
-                             : "=d" (res) : "d" (num & -num));
-       return ((p - addr) << 4) + (res ^ 31);
+       num = *--p;
+       return ((p - addr) << 4) + ffz(num);
 }
 
 #define minix_test_and_set_bit(nr, addr)       __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))