Skip to content

Commit

Permalink
m68k: remove inline asm from minix_find_first_zero_bit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Roman Zippel <[email protected]>
Cc: Andreas Schwab <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and torvalds committed Mar 24, 2011
1 parent f312eff commit 3fca5af
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions arch/m68k/include/asm/bitops_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3fca5af

Please sign in to comment.