Skip to contentSkip to conversation

asm-generic/bitops: Update stale comment

PATCH Applied Will Deacon 3 participants 3 messages Feb 13, 2020 – Mar 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asm-generic/bitops: Update stale comment

The comment in 'asm-generic/bitops.h' states that you should "recode these in the native assembly language, if at all possible". This is pretty crappy advice now that the generic implementation is defined in terms of atomic_long_t rather than a spinlock, so update the comment and hopefully save future architecture maintainers a bit of work.

---
 include/asm-generic/bitops.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/asm-generic/bitops.h +3 -2
index bfc96bf6606e..df9b5bc3d282 100644
@@ -4,8 +4,9 @@
 
 /*
  * For the benefit of those who are trying to port Linux to another
- * architecture, here are some C-language equivalents.  You should
- * recode these in the native assembly language, if at all possible.
+ * architecture, here are some C-language equivalents.  They should
+ * generate reasonable code, so take a look at what your compiler spits
+ * out before rolling your own buggy implementation in assembly language.
  *
  * C language equivalents written by Theodore Ts'o, 9/26/92
  */
Signature · 1 line
2.25.0.265.gbab2e86ba0-goog
#1 lore raw
Quoted 9 lines · Will Deacon

The comment in 'asm-generic/bitops.h' states that you should "recode these in the native assembly language, if at all possible". This is pretty crappy advice now that the generic implementation is defined in terms of atomic_long_t rather than a spinlock, so update the comment and hopefully save future architecture maintainers a bit of work.

Thanks Will!

merge bot Applied
#2 lore raw
In reply to Will Deacon
The following commit has been merged into the locking/core branch of tip:

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     5d0c9b0eb8ab2dd540919174abe75aa3b86b802f
Gitweb:        https://git.kernel.org/tip/5d0c9b0eb8ab2dd540919174abe75aa3b86b802f
Author:        Will Deacon <[email protected]>
AuthorDate:    Thu, 13 Feb 2020 09:39:27 
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Fri, 06 Mar 2020 11:06:19 +01:00

asm-generic/bitops: Update stale comment

The comment in 'asm-generic/bitops.h' states that you should "recode these in the native assembly language, if at all possible". This is pretty crappy advice now that the generic implementation is defined in terms of atomic_long_t rather than a spinlock, so update the comment and hopefully save future architecture maintainers a bit of work.

---
 include/asm-generic/bitops.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/asm-generic/bitops.h +3 -2
index bfc96bf..df9b5bc 100644
@@ -4,8 +4,9 @@
 
 /*
  * For the benefit of those who are trying to port Linux to another
- * architecture, here are some C-language equivalents.  You should
- * recode these in the native assembly language, if at all possible.
+ * architecture, here are some C-language equivalents.  They should
+ * generate reasonable code, so take a look at what your compiler spits
+ * out before rolling your own buggy implementation in assembly language.
  *
  * C language equivalents written by Theodore Ts'o, 9/26/92
  */