riscv/atomic.h : use RISCV_FULL_BARRIER in _arch_atomic* function.
Subsystems (2)
PATCH 1/1 riscv/atomic.h : use RISCV_FULL_BARRIER in _arch_atomic* function.
From: Zongmin Zhou <[email protected]>
Replace the same code with the pre-defined macroRISCV_FULL_BARRIER to simplify the code.
Signed-off-by Zongmin Zhou <[email protected]>
--- arch/riscv/include/asm/atomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/riscv/include/asm/atomic.h +4 -4
@@ -203,7 +203,7 @@ ATOMIC_OPS(xor, xor, i)" add %[rc], %[p], %[a]\n" \" sc." sfx".rl %[rc], %[rc], %[c]\n" \" bnez %[rc], 0b\n" \ -" fence rw, rw\n" \ +RISCV_FULL_BARRIER \"1:\n" \ : [p]"=&r" (_prev), [rc]"=&r" (_rc), [c]"+A" (counter) \: [a]" r" (_a), [u]" r" (_u) \
@@ -242,7 +242,7 @@ static __always_inline s64 arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a," addi %[rc], %[p], 1\n" \" sc." sfx".rl %[rc], %[rc], %[c]\n" \" bnez %[rc], 0b\n" \ -" fence rw, rw\n" \ +RISCV_FULL_BARRIER \"1:\n" \ : [p]"=&r" (_prev), [rc]"=&r" (_rc), [c]"+A" (counter) \: \
@@ -268,7 +268,7 @@ static __always_inline bool arch_atomic_inc_unless_negative(atomic_t *v)" addi %[rc], %[p], -1\n" \" sc." sfx".rl %[rc], %[rc], %[c]\n" \" bnez %[rc], 0b\n" \ -" fence rw, rw\n" \ +RISCV_FULL_BARRIER \"1:\n" \ : [p]"=&r" (_prev), [rc]"=&r" (_rc), [c]"+A" (counter) \: \
@@ -294,7 +294,7 @@ static __always_inline bool arch_atomic_dec_unless_positive(atomic_t *v)" bltz %[rc], 1f\n" \" sc." sfx".rl %[rc], %[rc], %[c]\n" \" bnez %[rc], 0b\n" \ -" fence rw, rw\n" \ +RISCV_FULL_BARRIER \"1:\n" \ : [p]"=&r" (_prev), [rc]"=&r" (_rc), [c]"+A" (counter) \: \
Signature · 1 line
2.34.1
This patch was applied to riscv/linux.git (for-next) by Paul Walmsley <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (for-next) by Paul Walmsley <[email protected]>:
Quoted 8 lines · On Thu, 20 Nov 2025 17:58:31 +0800 you wrote:
From: Zongmin Zhou <[email protected]>
Replace the same code with the pre-defined macro
RISCV_FULL_BARRIERto simplify the code.Signed-off-by Zongmin Zhou <[email protected]>[...]
Here is the summary with links:
- riscv/atomic.h : use RISCV_FULL_BARRIER in _arch_atomic* function.
https://git.kernel.org/riscv/c/c0fe46b64f12
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html