• Paul Burton's avatar
    MIPS: atomic: Unify 32b & 64b sub_if_positive · 40e784b4
    Paul Burton authored
    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: default avatarPaul 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
    40e784b4
atomic.h 8.22 KB