diff options
author | Mark Rutland <mark.rutland@arm.com> | 2019-05-22 14:22:48 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-03 12:32:57 +0200 |
commit | 3724921396dd1a07c93e3516b8d7c9ff570d17a9 (patch) | |
tree | 412b588eba2698a5724c058aed1660315d1fd00a /include/linux/types.h | |
parent | 79c53a83d7a31a5b5c7bafce4f0723bebf26836a (diff) | |
download | linux-3724921396dd1a07c93e3516b8d7c9ff570d17a9.tar.gz linux-3724921396dd1a07c93e3516b8d7c9ff570d17a9.tar.bz2 linux-3724921396dd1a07c93e3516b8d7c9ff570d17a9.zip |
locking/atomic: Use s64 for atomic64_t on 64-bit
Now that all architectures use 64 consistently as the base type for the
atomic64 API, let's have the CONFIG_64BIT definition of atomic64_t use
s64 as the underlying type for atomic64_t, rather than long, matching
the generated headers.
On architectures where atomic64_read(v) is READ_ONCE(v->counter), this
patch will cause the return type of atomic64_read() to be s64.
As of this patch, the atomic64 API can be relied upon to consistently
return s64 where a value rather than boolean condition is returned. This
should make code more robust, and simpler, allowing for the removal of
casts previously required to ensure consistent types.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: aou@eecs.berkeley.edu
Cc: arnd@arndb.de
Cc: bp@alien8.de
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: fenghua.yu@intel.com
Cc: heiko.carstens@de.ibm.com
Cc: herbert@gondor.apana.org.au
Cc: ink@jurassic.park.msu.ru
Cc: jhogan@kernel.org
Cc: linux@armlinux.org.uk
Cc: mattst88@gmail.com
Cc: mpe@ellerman.id.au
Cc: palmer@sifive.com
Cc: paul.burton@mips.com
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: rth@twiddle.net
Cc: tony.luck@intel.com
Cc: vgupta@synopsys.com
Link: https://lkml.kernel.org/r/20190522132250.26499-17-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/types.h')
-rw-r--r-- | include/linux/types.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/types.h b/include/linux/types.h index 231114ae38f4..05030f608be3 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -174,7 +174,7 @@ typedef struct { #ifdef CONFIG_64BIT typedef struct { - long counter; + s64 counter; } atomic64_t; #endif |