summaryrefslogtreecommitdiff
path: root/arch/alpha/include/asm/bitops.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 16:53:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 16:53:16 -0700
commitce7d0226198aac42ed311dd2783232adc16b296d (patch)
tree64ae863b9fbae4cd16da8a2d8553573bd676e23c /arch/alpha/include/asm/bitops.h
parentb142ebb61cd36370c6fac5e0b8261a6cd7bba782 (diff)
parenta75f5f0f0a3676216e0015b3040c785dbfe1e0da (diff)
Merge branch 'alpha-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6
* 'alpha-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6: alpha: simplify and optimize sched_find_first_bit alpha: invoke oom-killer from page fault Convert alpha to use clocksources instead of arch_gettimeoffset
Diffstat (limited to 'arch/alpha/include/asm/bitops.h')
-rw-r--r--arch/alpha/include/asm/bitops.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index 296da1d5ed57..1dce24bc455a 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -438,22 +438,20 @@ static inline unsigned int __arch_hweight8(unsigned int w)
/*
* Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
- * bits is set.
+ * way of searching a 100-bit bitmap. It's guaranteed that at least
+ * one of the 100 bits is cleared.
*/
static inline unsigned long
-sched_find_first_bit(unsigned long b[3])
+sched_find_first_bit(const unsigned long b[2])
{
- unsigned long b0 = b[0], b1 = b[1], b2 = b[2];
- unsigned long ofs;
+ unsigned long b0, b1, ofs, tmp;
- ofs = (b1 ? 64 : 128);
- b1 = (b1 ? b1 : b2);
- ofs = (b0 ? 0 : ofs);
- b0 = (b0 ? b0 : b1);
+ b0 = b[0];
+ b1 = b[1];
+ ofs = (b0 ? 0 : 64);
+ tmp = (b0 ? b0 : b1);
- return __ffs(b0) + ofs;
+ return __ffs(tmp) + ofs;
}
#include <asm-generic/bitops/ext2-non-atomic.h>