diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-09-25 08:14:08 +0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-09-28 00:08:56 +0400 |
commit | b924a69067b00d3121debae5a738fb0bcbbbb03c (patch) | |
tree | 574ab34819b91df7e7b4eb9cf750d3c6853033f3 /arch/tile/include/asm/atomic.h | |
parent | 4a10c2ac2f368583138b774ca41fac4207911983 (diff) | |
download | linux-b924a69067b00d3121debae5a738fb0bcbbbb03c.tar.xz |
tile: include: asm: use 'long long' instead of 'u64' for atomic64_t and its related functions
atomic* value is signed value, and atomic* functions need also process
signed value (parameter value, and return value), so use 'long long'
instead of 'u64'.
After replacement, it will also fix a bug for atomic64_add_negative():
"u64 is never less than 0".
The modifications are:
in vim, use "1,% s/\<u64\>/long long/g" command.
remove redundant '__aligned(8)'.
be sure of 80 (and macro '\') columns limitation after replacement.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> [re-instated const cast]
Diffstat (limited to 'arch/tile/include/asm/atomic.h')
-rw-r--r-- | arch/tile/include/asm/atomic.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index d385eaadece7..709798460763 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h @@ -166,7 +166,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int o, int n) * * Atomically sets @v to @i and returns old @v */ -static inline u64 atomic64_xchg(atomic64_t *v, u64 n) +static inline long long atomic64_xchg(atomic64_t *v, long long n) { return xchg64(&v->counter, n); } @@ -180,7 +180,8 @@ static inline u64 atomic64_xchg(atomic64_t *v, u64 n) * Atomically checks if @v holds @o and replaces it with @n if so. * Returns the old value at @v. */ -static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n) +static inline long long atomic64_cmpxchg(atomic64_t *v, long long o, + long long n) { return cmpxchg64(&v->counter, o, n); } |