lkml.org 
[lkml]   [2020]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH 7/8] locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros
On Fri, Jan 10, 2020 at 5:57 PM Will Deacon <will@kernel.org> wrote:

> @@ -128,10 +128,10 @@ do { \
> #ifndef __smp_load_acquire
> #define __smp_load_acquire(p) \
> ({ \
> - typeof(*p) ___p1 = READ_ONCE(*p); \
> + __unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
> compiletime_assert_atomic_type(*p); \
> __smp_mb(); \
> - ___p1; \
> + (typeof(*p))___p1; \
> })

Doesn't that last (typeof(*p))___p1 mean you put the potential
'volatile' back on the assignment after you went through the
effort of taking it out?

Arnd

\
 
 \ /
  Last update: 2020-01-10 20:43    [W:0.219 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site