linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] asm-generic/bitops: Update stale comment
@ 2020-02-13  9:39 Will Deacon
  2020-02-13 10:47 ` Peter Zijlstra
  2020-03-06 10:39 ` [tip: locking/core] " tip-bot2 for Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Will Deacon @ 2020-02-13  9:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: stefana, Will Deacon, Peter Zijlstra

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.

Cc: Peter Zijlstra <peterz@infradead.org>
Reported-by: Stefan Asserhall <stefana@xilinx.com>
Signed-off-by: Will Deacon <will@kernel.org>
---
 include/asm-generic/bitops.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index bfc96bf6606e..df9b5bc3d282 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -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
  */
-- 
2.25.0.265.gbab2e86ba0-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] asm-generic/bitops: Update stale comment
  2020-02-13  9:39 [PATCH] asm-generic/bitops: Update stale comment Will Deacon
@ 2020-02-13 10:47 ` Peter Zijlstra
  2020-03-06 10:39 ` [tip: locking/core] " tip-bot2 for Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2020-02-13 10:47 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-kernel, stefana

On Thu, Feb 13, 2020 at 09:39:27AM +0000, Will Deacon wrote:
> 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.
> 
> Cc: Peter Zijlstra <peterz@infradead.org>
> Reported-by: Stefan Asserhall <stefana@xilinx.com>
> Signed-off-by: Will Deacon <will@kernel.org>

Thanks Will!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: locking/core] asm-generic/bitops: Update stale comment
  2020-02-13  9:39 [PATCH] asm-generic/bitops: Update stale comment Will Deacon
  2020-02-13 10:47 ` Peter Zijlstra
@ 2020-03-06 10:39 ` tip-bot2 for Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Will Deacon @ 2020-03-06 10:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Stefan Asserhall, Will Deacon, Peter Zijlstra (Intel), x86, LKML

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 <will@kernel.org>
AuthorDate:    Thu, 13 Feb 2020 09:39:27 
Committer:     Peter Zijlstra <peterz@infradead.org>
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.

Reported-by: Stefan Asserhall <stefana@xilinx.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200213093927.1836-1-will@kernel.org
---
 include/asm-generic/bitops.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index bfc96bf..df9b5bc 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -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
  */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-06 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  9:39 [PATCH] asm-generic/bitops: Update stale comment Will Deacon
2020-02-13 10:47 ` Peter Zijlstra
2020-03-06 10:39 ` [tip: locking/core] " tip-bot2 for Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).