aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
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))