Skip to content

Commit b1ada60

Browse files
antonblanchardozbenh
authored andcommitted
atomic: Allow atomic_inc_not_zero to be overridden
We want to implement a ppc64 specific version of atomic_inc_not_zero so wrap it in an ifdef to allow it to be overridden. Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent 6c15d7a commit b1ada60

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/atomic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
2424
* Atomically increments @v by 1, so long as @v is non-zero.
2525
* Returns non-zero if @v was non-zero, and zero otherwise.
2626
*/
27+
#ifndef atomic_inc_not_zero
2728
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
29+
#endif
2830

2931
/**
3032
* atomic_inc_not_zero_hint - increment if not null

0 commit comments

Comments
 (0)