diff options
Diffstat (limited to 'include/asm-generic/atomic.h')
-rw-r--r-- | include/asm-generic/atomic.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 5ae6dce1cba2..85fd0aa27a8c 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <asm/system.h> | ||
13 | 12 | ||
14 | /* | 13 | /* |
15 | * Suppport for atomic_long_t | 14 | * Suppport for atomic_long_t |
@@ -123,8 +122,12 @@ static inline long atomic_long_dec_return(atomic_long_t *l) | |||
123 | return (long)atomic64_dec_return(v); | 122 | return (long)atomic64_dec_return(v); |
124 | } | 123 | } |
125 | 124 | ||
126 | #define atomic_long_add_unless(l, a, u) \ | 125 | static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) |
127 | atomic64_add_unless((atomic64_t *)(l), (a), (u)) | 126 | { |
127 | atomic64_t *v = (atomic64_t *)l; | ||
128 | |||
129 | return (long)atomic64_add_unless(v, a, u); | ||
130 | } | ||
128 | 131 | ||
129 | #define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l)) | 132 | #define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l)) |
130 | 133 | ||
@@ -236,8 +239,12 @@ static inline long atomic_long_dec_return(atomic_long_t *l) | |||
236 | return (long)atomic_dec_return(v); | 239 | return (long)atomic_dec_return(v); |
237 | } | 240 | } |
238 | 241 | ||
239 | #define atomic_long_add_unless(l, a, u) \ | 242 | static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) |
240 | atomic_add_unless((atomic_t *)(l), (a), (u)) | 243 | { |
244 | atomic_t *v = (atomic_t *)l; | ||
245 | |||
246 | return (long)atomic_add_unless(v, a, u); | ||
247 | } | ||
241 | 248 | ||
242 | #define atomic_long_inc_not_zero(l) atomic_inc_not_zero((atomic_t *)(l)) | 249 | #define atomic_long_inc_not_zero(l) atomic_inc_not_zero((atomic_t *)(l)) |
243 | 250 | ||