MIPS: bitops: Handle !kernel_uses_llsc first
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:25 +0000 (21:53 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 7 Oct 2019 16:42:37 +0000 (09:42 -0700)
commitfe7cd97e68fac186492847f8eda0eff8bcfb0cbc
tree7867ed0a23d1df9f8a5567369b17a9469590344b
parent1da7bce8591d58bf2a442b0324659af7390401c2
MIPS: bitops: Handle !kernel_uses_llsc first

Reorder conditions in our various bitops functions that check
kernel_uses_llsc such that they handle the !kernel_uses_llsc case first.
This allows us to avoid the need to duplicate the kernel_uses_llsc check
in all the other cases. For functions that don't involve barriers common
to the various implementations, we switch to returning from within each
if block making each case easier to read in isolation.

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/bitops.h