From: David Howells Date: Fri, 6 Jan 2006 08:11:59 +0000 (-0800) Subject: [PATCH] x86: handle -Wsign-compare in bitops X-Git-Tag: v2.6.16-rc1~936^2~197 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d89c145c0344fe2180336af6a309a59a8bc8c1c0;p=~emulex%2Finfiniband.git [PATCH] x86: handle -Wsign-compare in bitops Make i386's find_first_bit() use an unsigned integer as a counter to avoid getting warnings when -Wsign-compare is given. Signed-Off-By: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h index 4807aa1d2e3..26eb9811712 100644 --- a/include/asm-i386/bitops.h +++ b/include/asm-i386/bitops.h @@ -332,9 +332,9 @@ static inline unsigned long __ffs(unsigned long word) * Returns the bit-number of the first set bit, not the number of the byte * containing a bit. */ -static inline int find_first_bit(const unsigned long *addr, unsigned size) +static inline unsigned find_first_bit(const unsigned long *addr, unsigned size) { - int x = 0; + unsigned x = 0; while (x < size) { unsigned long val = *addr++;