diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-14 05:39:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-14 05:39:40 -0700 |
| commit | ebc7bc428067d8ce745d787a2fbdd593e645bef9 (patch) | |
| tree | 178a4be6d4ab88e479364b9ec343c2a8437ce9de /include/asm-ppc64/atomic.h | |
| parent | b5fc1438a06e40000dd9510ded6f950fd613c131 (diff) | |
[PATCH] Implement atomic_add_negative() on various architectures
Lots of architectures have atomic_add_return() and no atomic_add_negative().
We can implement the latter in terms of the former.
Diffstat (limited to 'include/asm-ppc64/atomic.h')
| -rw-r--r-- | include/asm-ppc64/atomic.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-ppc64/atomic.h b/include/asm-ppc64/atomic.h index 00617e2185af..39b11781a69d 100644 --- a/include/asm-ppc64/atomic.h +++ b/include/asm-ppc64/atomic.h @@ -54,6 +54,8 @@ static __inline__ int atomic_add_return(int a, atomic_t *v) return t; } +#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) + static __inline__ void atomic_sub(int a, atomic_t *v) { int t; |
