diff options
author | Mark Rutland <mark.rutland@arm.com> | 2018-06-21 13:13:08 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-06-21 14:22:33 +0200 |
commit | bef828204a1bc7a0fd3a24551c4265e9c2ab95ed (patch) | |
tree | bb35ac3bc791547c1345aaa737406f9b315a9e63 /arch/sparc | |
parent | ade5ef9280c33993099199c51e2e27c2c4013afd (diff) | |
download | blackbird-obmc-linux-bef828204a1bc7a0fd3a24551c4265e9c2ab95ed.tar.gz blackbird-obmc-linux-bef828204a1bc7a0fd3a24551c4265e9c2ab95ed.zip |
atomics/treewide: Make atomic64_inc_not_zero() optional
We define a trivial fallback for atomic_inc_not_zero(), but don't do
the same for atomic64_inc_not_zero(), leading most architectures to
define the same boilerplate.
Let's add a fallback in <linux/atomic.h>, and remove the redundant
implementations. Note that atomic64_add_unless() is always defined in
<linux/atomic.h>, and promotes its arguments to the requisite types, so
we need not do this explicitly.
There should be no functional change as a result of this patch.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Palmer Dabbelt <palmer@sifive.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/lkml/20180621121321.4761-6-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/atomic_64.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index f416fd3d2708..07830a316464 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h @@ -123,8 +123,6 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u) return c != (u); } -#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) - long atomic64_dec_if_positive(atomic64_t *v); #endif /* !(__ARCH_SPARC64_ATOMIC__) */ |