[Linux-cachefs] [PATCH 1/12] FS-Cache: Handle -Wsign-compare in i386 bitops

David Howells dhowells at redhat.com
Mon Nov 14 21:54:37 UTC 2005


The attached patch makes 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 <dhowells at redhat.com>
---
warthog>diffstat -p1 asm-i386-bitops-2614mm2.diff
 include/asm-i386/bitops.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -uNrp linux-2.6.14-mm2/include/asm-i386/bitops.h linux-2.6.14-mm2-cachefs/include/asm-i386/bitops.h
--- linux-2.6.14-mm2/include/asm-i386/bitops.h	2005-08-30 13:56:33.000000000 +0100
+++ linux-2.6.14-mm2-cachefs/include/asm-i386/bitops.h	2005-11-14 16:23:38.000000000 +0000
@@ -332,9 +332,9 @@ static inline unsigned long __ffs(unsign
  * 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++;




More information about the Linux-cachefs mailing list