riscv: atomic: Optimize dec_if_positive functions

Current implementation wastes another register to pass the
argument, but we only need addi to calculate the result. Optimize
the code with minimize the usage of registers.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20220505035526.2974382-3-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
Guo Ren 2022-05-05 11:55:23 +08:00 • committed by Palmer Dabbelt
commit 1d7f6932c5
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889