All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Mark Rutland <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, peterz@infradead.org, mark.rutland@arm.com,
	torvalds@linux-foundation.org, vgupta@synopsys.com,
	will.deacon@arm.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, tglx@linutronix.de
Subject: [tip:locking/core] locking/atomic, arc: Use s64 for atomic64
Date: Mon, 3 Jun 2019 06:36:55 -0700	[thread overview]
Message-ID: <tip-16fbad086976574b99ea7019c0504d0194e95dc3@git.kernel.org> (raw)
In-Reply-To: <20190522132250.26499-6-mark.rutland@arm.com>

Commit-ID:  16fbad086976574b99ea7019c0504d0194e95dc3
Gitweb:     https://git.kernel.org/tip/16fbad086976574b99ea7019c0504d0194e95dc3
Author:     Mark Rutland <mark.rutland@arm.com>
AuthorDate: Wed, 22 May 2019 14:22:37 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 3 Jun 2019 12:32:56 +0200

locking/atomic, arc: Use s64 for atomic64

As a step towards making the atomic64 API use consistent types treewide,
let's have the arc atomic64 implementation use s64 as the underlying
type for atomic64_t, rather than u64, matching the generated headers.

Otherwise, there should be no functional change as a result of this
patch.

Acked-By: Vineet Gupta <vgupta@synopsys.com>
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
Link: https://lkml.kernel.org/r/20190522132250.26499-6-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/arc/include/asm/atomic.h | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
index 158af079838d..2c75df55d0d2 100644
--- a/arch/arc/include/asm/atomic.h
+++ b/arch/arc/include/asm/atomic.h
@@ -324,14 +324,14 @@ ATOMIC_OPS(xor, ^=, CTOP_INST_AXOR_DI_R2_R2_R3)
  */
 
 typedef struct {
-	aligned_u64 counter;
+	s64 __aligned(8) counter;
 } atomic64_t;
 
 #define ATOMIC64_INIT(a) { (a) }
 
-static inline long long atomic64_read(const atomic64_t *v)
+static inline s64 atomic64_read(const atomic64_t *v)
 {
-	unsigned long long val;
+	s64 val;
 
 	__asm__ __volatile__(
 	"	ldd   %0, [%1]	\n"
@@ -341,7 +341,7 @@ static inline long long atomic64_read(const atomic64_t *v)
 	return val;
 }
 
-static inline void atomic64_set(atomic64_t *v, long long a)
+static inline void atomic64_set(atomic64_t *v, s64 a)
 {
 	/*
 	 * This could have been a simple assignment in "C" but would need
@@ -362,9 +362,9 @@ static inline void atomic64_set(atomic64_t *v, long long a)
 }
 
 #define ATOMIC64_OP(op, op1, op2)					\
-static inline void atomic64_##op(long long a, atomic64_t *v)		\
+static inline void atomic64_##op(s64 a, atomic64_t *v)			\
 {									\
-	unsigned long long val;						\
+	s64 val;							\
 									\
 	__asm__ __volatile__(						\
 	"1:				\n"				\
@@ -375,13 +375,13 @@ static inline void atomic64_##op(long long a, atomic64_t *v)		\
 	"	bnz     1b		\n"				\
 	: "=&r"(val)							\
 	: "r"(&v->counter), "ir"(a)					\
-	: "cc");						\
+	: "cc");							\
 }									\
 
 #define ATOMIC64_OP_RETURN(op, op1, op2)		        	\
-static inline long long atomic64_##op##_return(long long a, atomic64_t *v)	\
+static inline s64 atomic64_##op##_return(s64 a, atomic64_t *v)		\
 {									\
-	unsigned long long val;						\
+	s64 val;							\
 									\
 	smp_mb();							\
 									\
@@ -402,9 +402,9 @@ static inline long long atomic64_##op##_return(long long a, atomic64_t *v)	\
 }
 
 #define ATOMIC64_FETCH_OP(op, op1, op2)		        		\
-static inline long long atomic64_fetch_##op(long long a, atomic64_t *v)	\
+static inline s64 atomic64_fetch_##op(s64 a, atomic64_t *v)		\
 {									\
-	unsigned long long val, orig;					\
+	s64 val, orig;							\
 									\
 	smp_mb();							\
 									\
@@ -444,10 +444,10 @@ ATOMIC64_OPS(xor, xor, xor)
 #undef ATOMIC64_OP_RETURN
 #undef ATOMIC64_OP
 
-static inline long long
-atomic64_cmpxchg(atomic64_t *ptr, long long expected, long long new)
+static inline s64
+atomic64_cmpxchg(atomic64_t *ptr, s64 expected, s64 new)
 {
-	long long prev;
+	s64 prev;
 
 	smp_mb();
 
@@ -467,9 +467,9 @@ atomic64_cmpxchg(atomic64_t *ptr, long long expected, long long new)
 	return prev;
 }
 
-static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
+static inline s64 atomic64_xchg(atomic64_t *ptr, s64 new)
 {
-	long long prev;
+	s64 prev;
 
 	smp_mb();
 
@@ -495,9 +495,9 @@ static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
  * the atomic variable, v, was not decremented.
  */
 
-static inline long long atomic64_dec_if_positive(atomic64_t *v)
+static inline s64 atomic64_dec_if_positive(atomic64_t *v)
 {
-	long long val;
+	s64 val;
 
 	smp_mb();
 
@@ -528,10 +528,9 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)
  * Atomically adds @a to @v, if it was not @u.
  * Returns the old value of @v
  */
-static inline long long atomic64_fetch_add_unless(atomic64_t *v, long long a,
-						  long long u)
+static inline s64 atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u)
 {
-	long long old, temp;
+	s64 old, temp;
 
 	smp_mb();
 

  parent reply	other threads:[~2019-06-03 13:37 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 13:22 [PATCH 00/18] locking/atomic: atomic64 type cleanup Mark Rutland
2019-05-22 13:22 ` [PATCH 01/18] locking/atomic: crypto: nx: prepare for atomic64_read() conversion Mark Rutland
2019-06-03 13:34   ` [tip:locking/core] locking/atomic, crypto/nx: Prepare " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 02/18] locking/atomic: s390/pci: prepare " Mark Rutland
2019-06-03 13:34   ` [tip:locking/core] locking/atomic, s390/pci: Prepare " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 03/18] locking/atomic: generic: use s64 for atomic64 Mark Rutland
2019-05-22 21:16   ` Arnd Bergmann
2019-06-03 13:35   ` [tip:locking/core] locking/atomic: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 04/18] locking/atomic: alpha: use " Mark Rutland
2019-06-03 13:36   ` [tip:locking/core] locking/atomic, alpha: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 05/18] locking/atomic: arc: use " Mark Rutland
2019-05-23 23:10   ` Vineet Gupta
2019-06-03 13:36   ` tip-bot for Mark Rutland [this message]
2019-05-22 13:22 ` [PATCH 06/18] locking/atomic: arm: " Mark Rutland
2019-06-03 13:37   ` [tip:locking/core] locking/atomic, arm: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 07/18] locking/atomic: arm64: use " Mark Rutland
2019-06-03 13:38   ` [tip:locking/core] locking/atomic, arm64: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 08/18] locking/atomic: ia64: use " Mark Rutland
2019-06-03 13:39   ` [tip:locking/core] locking/atomic, ia64: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 09/18] locking/atomic: mips: use " Mark Rutland
2019-06-03 13:39   ` [tip:locking/core] locking/atomic, mips: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 10/18] locking/atomic: powerpc: use " Mark Rutland
2019-05-23 13:27   ` Michael Ellerman
2019-06-03 13:40   ` [tip:locking/core] locking/atomic, powerpc: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 11/18] locking/atomic: riscv: fix atomic64_sub_if_positive() offset argument Mark Rutland
2019-05-22 19:06   ` Palmer Dabbelt
2019-06-03 13:41   ` [tip:locking/core] locking/atomic, riscv: Fix " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 12/18] locking/atomic: riscv: use s64 for atomic64 Mark Rutland
2019-05-22 19:06   ` Palmer Dabbelt
2019-05-23 10:23     ` Mark Rutland
2019-06-03 13:41   ` [tip:locking/core] locking/atomic, riscv: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 13/18] locking/atomic: s390: use " Mark Rutland
2019-06-03 13:42   ` [tip:locking/core] locking/atomic, s390: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 14/18] locking/atomic: sparc: use " Mark Rutland
2019-06-03 13:43   ` [tip:locking/core] locking/atomic, sparc: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 15/18] locking/atomic: x86: use " Mark Rutland
2019-06-03 13:44   ` [tip:locking/core] locking/atomic, x86: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 16/18] locking/atomic: use s64 for atomic64_t on 64-bit Mark Rutland
2019-06-03 13:44   ` [tip:locking/core] locking/atomic: Use " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 17/18] locking/atomic: crypto: nx: remove redundant casts Mark Rutland
2019-06-03 13:45   ` [tip:locking/core] locking/atomic, crypto/nx: Remove " tip-bot for Mark Rutland
2019-05-22 13:22 ` [PATCH 18/18] locking/atomic: s390/pci: remove " Mark Rutland
2019-06-03 13:46   ` [tip:locking/core] locking/atomic, s390/pci: Remove " tip-bot for Mark Rutland
2019-05-22 21:18 ` [PATCH 00/18] locking/atomic: atomic64 type cleanup Arnd Bergmann
2019-05-23 10:28   ` Mark Rutland
2019-05-23  8:30 ` Andrea Parri
2019-05-23 10:19   ` Mark Rutland
2019-05-23 11:20     ` Andrea Parri
2019-05-24 10:37     ` Peter Zijlstra
2019-05-24 11:18       ` Peter Zijlstra
2019-05-24 11:38         ` Greg KH
2019-05-24 11:42         ` Will Deacon
2019-05-24 11:52           ` Peter Zijlstra
2019-05-24 22:43             ` Andrea Parri
2019-05-28 10:47               ` Peter Zijlstra
2019-05-28 11:15                 ` Andrea Parri
2019-06-03 13:46             ` [tip:locking/core] Documentation/atomic_t.txt: Clarify pure non-rmw usage tip-bot for Peter Zijlstra
2019-06-06  8:44               ` Andrea Parri
2019-06-06  9:04                 ` Peter Zijlstra
2019-06-06  9:11                   ` Andrea Parri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-16fbad086976574b99ea7019c0504d0194e95dc3@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vgupta@synopsys.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.