Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4386780ybi; Mon, 3 Jun 2019 10:01:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2PjvkD0AB60Aj6aADCQ27Mes0Jsk78Z2USAzT8LfbcvNY8IdLtTy96jXLVjgunbxmKnJu X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr16289130plq.223.1559581273817; Mon, 03 Jun 2019 10:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559581273; cv=none; d=google.com; s=arc-20160816; b=MNNpJcfic0Tn5aKEar7D8TJx4XWSwTwcpLTDmF1V2dhbw3FfoyBDETn+E/mUHNxYtN QlciysoIrhpgpwennN6rpgYgX0xzutEzPjiKmcCsU5e0XH9NH/CRmPC1RjMXc5I7jwA0 we8m0GFG5i+J1oIMsK4v7fEK/DKFXUelxn0/JQg70rbaSS91asgcQUU2vUR6U3Aje42j V6jtC5NsHAW/dvvLwq7buKFZu/I+pFGzJEWY+9Pxa7WPA3z0u/flJiY55CmfDlFknzgp 6d9T18LNp7A3Z3QGUwnhkawJXnhMf4TK7RKx88jpX8QM6WInfknZBbx/ZRDTctEhFcjG tW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=y209N5hqjIengwRziW7lpeTaL+YzrJkvglcBMN43i88=; b=QJikNDMuFLTb+pPJNM9FBiyjGcUBl3vUN/riJSiw2aTAjH6qv1Ue9wM0CU/42v4I3B OlBFv2IYQaRZbDtQ0tTbSh/t1Au8MNzoFFcicwTU1T9vj9eBDLao0PGOnMD4dqWQxuLi s05hum2/v3fVc7XUUIaKYvFrWHPZPnH5WZrJt7w/KXRFACcadCOq8kKfezrRxKw53T85 yRM/3ydZCSG5si2pIBI67Qn9cY4YFFb11qLO7ZupIp9Q6iapYXLxeInBVRqcFUyeou6p 8rn2UpbO3qubsloAg10Y1d9HLzxDZ5wNwczodU6y5ym1MbvW8D0nFd0Rg6iV4RUYeEEy xMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=MDLpl7ni; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si5659524pgj.449.2019.06.03.10.00.55; Mon, 03 Jun 2019 10:01:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=MDLpl7ni; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbfFCNgl (ORCPT + 99 others); Mon, 3 Jun 2019 09:36:41 -0400 Received: from terminus.zytor.com ([198.137.202.136]:55687 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbfFCNgk (ORCPT ); Mon, 3 Jun 2019 09:36:40 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DaD7k611177 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:36:14 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DaD7k611177 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559568974; bh=y209N5hqjIengwRziW7lpeTaL+YzrJkvglcBMN43i88=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=MDLpl7niFtKkXBjg7HJtP4cAauQxWBwLpeA9dWjMwSb0HpMacctGkiseN2ot0LJvh 4LF/VvFa25lz1gWWuWm9mSASpK4A+o3D36Io5G7Jnzjlj7kEgkR4fE9nfIcAnVoEg8 jSlk+EVkxNBAVcI2gWch4xq20wvdCwato3nHsadAcZo1CQoi1asctm57NRo8WGC60g hRCkmWeSBjZqSfEPM4vIiYF3RJKXTmAne8x2Blz2j9Wg8EcToin7pLUdbGnZdXzDFO wjQmlV8L5CqYcDO8q863cGfuaDDvMRnz2DFZXnYsyL3sKOJPfD2zfb9UMKMVFMoWIa J4NRZmY3JJ08w== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53DaDUF611171; Mon, 3 Jun 2019 06:36:13 -0700 Date: Mon, 3 Jun 2019 06:36:13 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Mark Rutland Message-ID: Cc: torvalds@linux-foundation.org, rth@twiddle.net, peterz@infradead.org, will.deacon@arm.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, mattst88@gmail.com, ink@jurassic.park.msu.ru, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de Reply-To: will.deacon@arm.com, rth@twiddle.net, torvalds@linux-foundation.org, ink@jurassic.park.msu.ru, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, mattst88@gmail.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com In-Reply-To: <20190522132250.26499-5-mark.rutland@arm.com> References: <20190522132250.26499-5-mark.rutland@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/atomic, alpha: Use s64 for atomic64 Git-Commit-ID: 0203fdc160a8c8d8651a3b79aa453ec36cfbd867 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0203fdc160a8c8d8651a3b79aa453ec36cfbd867 Gitweb: https://git.kernel.org/tip/0203fdc160a8c8d8651a3b79aa453ec36cfbd867 Author: Mark Rutland AuthorDate: Wed, 22 May 2019 14:22:36 +0100 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 12:32:56 +0200 locking/atomic, alpha: Use s64 for atomic64 As a step towards making the atomic64 API use consistent types treewide, let's have the alpha atomic64 implementation use s64 as the underlying type for atomic64_t, rather than long, matching the generated headers. As atomic64_read() depends on the generic defintion of atomic64_t, this still returns long. This will be converted in a subsequent patch. Otherwise, there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Cc: Ivan Kokshaysky Cc: Linus Torvalds Cc: Matt Turner Cc: Peter Zijlstra Cc: Richard Henderson Cc: Thomas Gleixner Cc: Will Deacon 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: jhogan@kernel.org Cc: linux@armlinux.org.uk Cc: mpe@ellerman.id.au Cc: palmer@sifive.com Cc: paul.burton@mips.com Cc: paulus@samba.org Cc: ralf@linux-mips.org Cc: tony.luck@intel.com Cc: vgupta@synopsys.com Link: https://lkml.kernel.org/r/20190522132250.26499-5-mark.rutland@arm.com Signed-off-by: Ingo Molnar --- arch/alpha/include/asm/atomic.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h index 150a1c5d6a2c..2144530d1428 100644 --- a/arch/alpha/include/asm/atomic.h +++ b/arch/alpha/include/asm/atomic.h @@ -93,9 +93,9 @@ static inline int atomic_fetch_##op##_relaxed(int i, atomic_t *v) \ } #define ATOMIC64_OP(op, asm_op) \ -static __inline__ void atomic64_##op(long i, atomic64_t * v) \ +static __inline__ void atomic64_##op(s64 i, atomic64_t * v) \ { \ - unsigned long temp; \ + s64 temp; \ __asm__ __volatile__( \ "1: ldq_l %0,%1\n" \ " " #asm_op " %0,%2,%0\n" \ @@ -109,9 +109,9 @@ static __inline__ void atomic64_##op(long i, atomic64_t * v) \ } \ #define ATOMIC64_OP_RETURN(op, asm_op) \ -static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \ +static __inline__ s64 atomic64_##op##_return_relaxed(s64 i, atomic64_t * v) \ { \ - long temp, result; \ + s64 temp, result; \ __asm__ __volatile__( \ "1: ldq_l %0,%1\n" \ " " #asm_op " %0,%3,%2\n" \ @@ -128,9 +128,9 @@ static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \ } #define ATOMIC64_FETCH_OP(op, asm_op) \ -static __inline__ long atomic64_fetch_##op##_relaxed(long i, atomic64_t * v) \ +static __inline__ s64 atomic64_fetch_##op##_relaxed(s64 i, atomic64_t * v) \ { \ - long temp, result; \ + s64 temp, result; \ __asm__ __volatile__( \ "1: ldq_l %2,%1\n" \ " " #asm_op " %2,%3,%0\n" \ @@ -246,9 +246,9 @@ static __inline__ int atomic_fetch_add_unless(atomic_t *v, int a, int u) * Atomically adds @a to @v, so long as it was not @u. * Returns the old value of @v. */ -static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) +static __inline__ s64 atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) { - long c, new, old; + s64 c, new, old; smp_mb(); __asm__ __volatile__( "1: ldq_l %[old],%[mem]\n" @@ -276,9 +276,9 @@ static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) * The function returns the old value of *v minus 1, even if * the atomic variable, v, was not decremented. */ -static inline long atomic64_dec_if_positive(atomic64_t *v) +static inline s64 atomic64_dec_if_positive(atomic64_t *v) { - long old, tmp; + s64 old, tmp; smp_mb(); __asm__ __volatile__( "1: ldq_l %[old],%[mem]\n"