From ff6888794bc7aa81aa21d5a8e2ff2be3d1a2d5df Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 29 Jul 2005 11:01:22 -0400 Subject: [PATCH] --- yaml --- r: 5457 b: refs/heads/master c: d6d2a2ab05da6e44bd127fe375078bb7c36a0ad0 h: refs/heads/master i: 5455: ce2e2a60f434bcaac113c29ffaada1163ac0c6fc v: v3 --- [refs] | 2 +- trunk/include/asm-i386/bitops.h | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index efcbee1d60d2..39c4595dead7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33ac02aa4cef417871e128ab4a6565e751e5f3b2 +refs/heads/master: d6d2a2ab05da6e44bd127fe375078bb7c36a0ad0 diff --git a/trunk/include/asm-i386/bitops.h b/trunk/include/asm-i386/bitops.h index 1caee1039363..ddf1739dc7fd 100644 --- a/trunk/include/asm-i386/bitops.h +++ b/trunk/include/asm-i386/bitops.h @@ -335,14 +335,13 @@ static inline unsigned long __ffs(unsigned long word) static inline int find_first_bit(const unsigned long *addr, unsigned size) { int x = 0; - do { - if (*addr) - return __ffs(*addr) + x; - addr++; - if (x >= size) - break; + + while (x < size) { + unsigned long val = *addr++; + if (val) + return __ffs(val) + x; x += (sizeof(*addr)<<3); - } while (1); + } return x; }