patch-2.4.0-test7 linux/include/asm-sparc64/bitops.h

Next file: linux/include/asm-sparc64/fcntl.h
Previous file: linux/include/asm-sparc/unistd.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.29 2000/06/30 10:18:39 davem Exp $
+/* $Id: bitops.h,v 1.30 2000/08/10 23:49:16 davem Exp $
  * bitops.h: Bit string operations on the V9.
  *
  * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -158,6 +158,8 @@
 
 found_first:
 	tmp |= ~0UL << size;
+	if (tmp == ~0UL)        /* Are any bits zero? */
+		return result + size; /* Nope. */
 found_middle:
 	return result + ffz(tmp);
 }
@@ -217,6 +219,8 @@
 	tmp = __swab64p(p);
 found_first:
 	tmp |= (~0UL << size);
+	if (tmp == ~0UL)        /* Are any bits zero? */
+		return result + size; /* Nope. */
 found_middle:
 	return result + ffz(tmp);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)