Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252078
b: refs/heads/master
c: 968d803
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed May 27, 2011
1 parent 6e2208c commit f0080fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 802caabbededeecbe433bcdb8a8ee0721836f7db
refs/heads/master: 968d803c98410910fbadca031b6a873d4bc12dd5
46 changes: 2 additions & 44 deletions trunk/arch/m68k/include/asm/bitops_no.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,50 +321,8 @@ static inline unsigned long find_next_zero_bit_le(void *addr, unsigned long size
}
#define find_next_zero_bit_le find_next_zero_bit_le

static inline unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
const unsigned long *p = addr;
unsigned long result = offset & ~(BITS_PER_LONG - 1);
unsigned long tmp;

if (offset >= size)
return size;
p += offset / BITS_PER_LONG;
size -= result;
offset &= (BITS_PER_LONG - 1UL);
if (offset) {
tmp = __swab32(*(p++));
tmp &= (~0UL << offset);
if (size < BITS_PER_LONG)
goto found_first;
if (tmp)
goto found_middle;
size -= BITS_PER_LONG;
result += BITS_PER_LONG;
}

while (size & ~(BITS_PER_LONG - 1)) {
tmp = *(p++);
if (tmp)
goto found_middle_swap;
result += BITS_PER_LONG;
size -= BITS_PER_LONG;
}
if (!size)
return result;
tmp = __swab32(*p);
found_first:
tmp &= (~0UL >> (BITS_PER_LONG - size));
if (tmp == 0UL) /* Are any bits set? */
return result + size; /* Nope. */
found_middle:
return result + __ffs(tmp);

found_middle_swap:
return result + __ffs(__swab32(tmp));
}
#define find_next_bit_le find_next_bit_le
extern unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset);

#endif /* __KERNEL__ */

Expand Down

0 comments on commit f0080fb

Please sign in to comment.