patch-2.4.0-test7 linux/include/asm-sparc/bitops.h
Next file: linux/include/asm-sparc/fcntl.h
Previous file: linux/include/asm-sh/unistd.h
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Sat Aug 12 12:08:50 2000
- Orig file:
v2.4.0-test6/linux/include/asm-sparc/bitops.h
- Orig date:
Thu Jul 27 17:38:02 2000
diff -u --recursive --new-file v2.4.0-test6/linux/include/asm-sparc/bitops.h linux/include/asm-sparc/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.59 2000/07/13 01:51:50 davem Exp $
+/* $Id: bitops.h,v 1.60 2000/08/10 23:49:16 davem Exp $
* bitops.h: Bit string operations on the Sparc.
*
* Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -232,6 +232,8 @@
found_first:
tmp |= ~0UL << size;
+ if (tmp == ~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
found_middle:
return result + ffz(tmp);
}
@@ -379,7 +381,11 @@
tmp = *p;
found_first:
- return result + ffz(__swab32(tmp) | (~0UL << size));
+ tmp = __swab32(tmp) | (~0UL << size);
+ if (tmp == ~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
+ return result + ffz(tmp);
+
found_middle:
return result + ffz(__swab32(tmp));
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)