]> git.baikalelectronics.ru Git - kernel.git/commit
locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros
authorWill Deacon <will@kernel.org>
Thu, 19 Dec 2019 16:22:56 +0000 (16:22 +0000)
committerWill Deacon <will@kernel.org>
Thu, 16 Apr 2020 11:28:34 +0000 (12:28 +0100)
commit2b5ead8d1adea2ea6a8f6bdc1c2b0a43d78e2322
tree94e5eacf68de2e01130f8f9767dbff130e8a3de7
parent3e4eb35985e0c1f991677aa62ec6c75a786d2e50
locking/barriers: Use '__unqual_scalar_typeof' for load-acquire macros

Passing volatile-qualified pointers to the asm-generic implementations of
the load-acquire macros results in a re-load from the stack due to the
temporary result variable inheriting the volatile semantics thanks to the
use of 'typeof()'.

Define these temporary variables using 'unqual_scalar_typeof' to drop
the volatile qualifier in the case that they are scalar types.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Will Deacon <will@kernel.org>
include/asm-generic/barrier.h