Skip to contentSkip to conversation

bitop - fix test_and_change_bit comment

PATCH New Paul Jackson 1 participant 1 message Apr 7, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitop - fix test_and_change_bit comment

Rusty, Andrew,

Is there a place in the world for this patch? I normally don't mess with comment fixes except as part of bigger stuff. But someone could stub their little toe on this one.

If you prefer, I'd be happy to bury this fix in with the cpumask and bitmap stuff I'm cooking up.

I've read over the code in each case, built and ran a test case for i386 in particular, and studied the other uses and definitions of test_and_change_bit(). Everything I see recommends this change.

* Fix test_and_change_bit() comment: returns old value, not new one.

===================================================================

include/asm-cris/bitops.h +1 -1
@@ -169,7 +169,7 @@
 	return retval;
 }
 /**
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to change
  * @addr: Address to count from
  *

===================================================================

include/asm-i386/bitops.h +1 -1
@@ -212,7 +212,7 @@
 }
 
 /**
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to change
  * @addr: Address to count from
  *

===================================================================

include/asm-ia64/bitops.h +1 -1
@@ -236,7 +236,7 @@
 }
 
 /**
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to set
  * @addr: Address to count from
  *

===================================================================

include/asm-mips/bitops.h +2 -2
@@ -296,7 +296,7 @@
 }
 
 /*
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to change
  * @addr: Address to count from
  *
@@ -567,7 +567,7 @@
 }
 
 /*
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to change
  * @addr: Address to count from
  *

===================================================================

include/asm-x86_64/bitops.h +1 -1
@@ -204,7 +204,7 @@
 }
 
 /**
- * test_and_change_bit - Change a bit and return its new value
+ * test_and_change_bit - Change a bit and return its old value
  * @nr: Bit to change
  * @addr: Address to count from
  *
Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373