Skip to content

Commit

Permalink
atomic: Allow atomic_inc_not_zero to be overridden
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Mar 7, 2012
1 parent 6c15d7a commit b1ada60
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
* Atomically increments @v by 1, so long as @v is non-zero.
* Returns non-zero if @v was non-zero, and zero otherwise.
*/
#ifndef atomic_inc_not_zero
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
#endif

/**
* atomic_inc_not_zero_hint - increment if not null
Expand Down

0 comments on commit b1ada60

Please sign in to comment.