patch-2.4.19 linux-2.4.19/include/asm-ia64/bitops.h

Next file: linux-2.4.19/include/asm-ia64/checksum.h
Previous file: linux-2.4.19/include/asm-ia64/acpi-ext.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/include/asm-ia64/bitops.h linux-2.4.19/include/asm-ia64/bitops.h
@@ -57,10 +57,10 @@
 }
 
 /*
- * clear_bit() doesn't provide any barrier for the compiler.
+ * clear_bit() has "acquire" semantics.
  */
 #define smp_mb__before_clear_bit()	smp_mb()
-#define smp_mb__after_clear_bit()	smp_mb()
+#define smp_mb__after_clear_bit()	do { /* skip */; } while (0)
 
 /**
  * clear_bit - Clears a bit in memory
@@ -357,6 +357,8 @@
 	tmp = *p;
 found_first:
 	tmp |= ~0UL << size;
+	if (tmp == ~0UL)		/* 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)