Re: [RFC PATCH 6/8] READ_ONCE: Drop pointer qualifiers when reading from scalar types

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2020-01-10 18:54:50
Also in
lkml
Reply to
Will Deacon, 2020-01-10
On Fri, Jan 10, 2020 at 8:56 AM Will Deacon [off-list ref] wrote:
+/* Declare an unqualified scalar type. Leaves non-scalar types unchanged. */
+#define __unqual_scalar_typeof(x) typeof(                                      \
Ugh. My eyes. That's horrendous.

I can't see any better alternatives, but it does make me go "Eww".

Well, I do see one possible alternative: just re-write the bitop
implementations in terms of "atomic_long_t", and just avoid the issue
entirely.

IOW, do something like the attached (but fleshed out and tested - this
patch has not seen a compiler, much less any thought at all).

                   Linus

Attachments

Thread (32 messages) 32 messages, 10 authors, last reply 2020-01-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help