]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: atomic: Unify 32b & 64b sub_if_positive
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:23 +0000 (21:53 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 7 Oct 2019 16:42:34 +0000 (09:42 -0700)
commite501f56cde99a2a598a4be077dda9500062b5f53
tree47ab76acb9d27ec4d5300286ac2ffcb427a3188f
parentec221926d3629f19f24c31eae701060aceaaab4f
MIPS: atomic: Unify 32b & 64b sub_if_positive

Unify the definitions of atomic_sub_if_positive() &
atomic64_sub_if_positive() using a macro like we do for most other
atomic functions. This allows us to share the implementation ensuring
consistency between the two. Notably this provides the appropriate
loongson3_war barriers in the atomic64_sub_if_positive() case which were
previously missing.

The code is rearranged a little to handle the !kernel_uses_llsc case
first in order to de-indent the LL/SC case & allow us not to go over 80
characters per line.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-kernel@vger.kernel.org
arch/mips/include/asm/atomic.h