Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

atomics/treewide: Remove redundant atomic_inc_not_zero() definitions

When atomic_inc_not_zero(v) isn't defined, <linux/atomic.h> will define
it as falling back to atomic_add_unless((v), 1, 0), so there's no need
for arch code to do so.

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-3-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Mark Rutland and committed by
Ingo Molnar
8b47038e bfc18e38

-13
-2
arch/arc/include/asm/atomic.h
··· 336 336 c; \ 337 337 }) 338 338 339 - #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 340 - 341 339 #define atomic_inc(v) atomic_add(1, v) 342 340 #define atomic_dec(v) atomic_sub(1, v) 343 341
-2
arch/hexagon/include/asm/atomic.h
··· 197 197 return __oldval; 198 198 } 199 199 200 - #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 201 - 202 200 #define atomic_inc(v) atomic_add(1, (v)) 203 201 #define atomic_dec(v) atomic_sub(1, (v)) 204 202
-9
arch/riscv/include/asm/atomic.h
··· 375 375 } 376 376 #endif 377 377 378 - /* 379 - * The extra atomic operations that are constructed from one of the core 380 - * LR/SC-based operations above. 381 - */ 382 - static __always_inline int atomic_inc_not_zero(atomic_t *v) 383 - { 384 - return atomic_fetch_add_unless(v, 1, 0); 385 - } 386 - 387 378 #ifndef CONFIG_GENERIC_ATOMIC64 388 379 static __always_inline long atomic64_inc_not_zero(atomic64_t *v) 389 380 {