riscv/atomic.h : Deduplicate arch_atomic.*
authorLeonardo Bras <leobras@redhat.com>
Wed, 3 Jan 2024 16:32:01 +0000 (13:32 -0300)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 8 Apr 2024 17:52:04 +0000 (10:52 -0700)
commit9061237392721f0e9b399161876fa36ddb6c4226
treee5aac32a4274afe0afd943811547aaa64c348eae
parent07a0a41cb77d582e4db05bd9e79daa145d5d6ea4
riscv/atomic.h : Deduplicate arch_atomic.*

Some functions use mostly the same asm for 32-bit and 64-bit versions.

Make a macro that is generic enough and avoid code duplication.

(This did not cause any change in generated asm)

Signed-off-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Andrea Parri <parri.andrea@gmail.com>
Tested-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20240103163203.72768-5-leobras@redhat.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/atomic.h