Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4163756ybi; Mon, 3 Jun 2019 06:43:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyB8PMCEpF7I37ALz/7yue0sm/FJzGFeg8ncNzGZ9vVPiQoD2BeB0x3mLpq/gK3B7yHKde X-Received: by 2002:a17:90a:de0e:: with SMTP id m14mr29823783pjv.36.1559569417084; Mon, 03 Jun 2019 06:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559569417; cv=none; d=google.com; s=arc-20160816; b=Ch5ZuXmYsTwah0LEmb883zkuR+WdV+2BJpcMdBJQ72+xApAzv+c6TK31T0VDHi3MKq YYfcGsTDGnjIHIG2FXlrMuNRC1Y/gqcp8tygVHGbeiXo2AXDf0vW9ytiJwQ8OLyrQEJf 08As19qcSsOz2JZmPwjLhT5c16d+JS9J7WVR8rdRTfPL+ov/uuiDnMkTVPe+gb4lGj7z 8JF766z+O5qnfyKlOunuZ9zJ4l7fXQM0P17ABPsF6q681GVnJFBqrruy2S3jaFktOdme 5zdMxulO/rQDtcy/7cQjIF2JxSqscWNMWPTlESrS6KDBswW0v6EIJaq9oDLFkTLGZKY/ pBgA== 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=ugDYpScCfry1yiNAFZlLVJ4QEvVOEsD3LZccOBLSkX8=; b=V0F7p6bk5vUK8GFiLk5oXoubxvnAH9gGpiSP5lkKDytYyzBLh8O4MH50gd8EBU+cDd o3Y0g0F7FtlZK8cEOsBljwAgN7lCI0e9fp5M8qEVIwBDxxL9QHKIsz3b2lGr/aGgBMCG K6qKWCb9drY9glPL526IcIXYQyeVhkl2A/ZfxGwY9dTTjOH6T7L90bIgnPvaWqlDNhuf kE8oJq6Gxw4fetG/8TdZ7w9AUosHwJEcqM0IIDB/eP6q+aMsvr8Eh7d94gXZ9e9DUndA /PMXbfXfVPRlMQ7FIB9fTe9sqpKWRqcJTV9BsKoMtYb2wAcepnyjD/qEQdu10SJrGeTr MnDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=SoxBGPZT; 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 b9si20084179pgq.253.2019.06.03.06.43.18; Mon, 03 Jun 2019 06:43:37 -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=SoxBGPZT; 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 S1728909AbfFCNlW (ORCPT + 99 others); Mon, 3 Jun 2019 09:41:22 -0400 Received: from terminus.zytor.com ([198.137.202.136]:54363 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727506AbfFCNlW (ORCPT ); Mon, 3 Jun 2019 09:41:22 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53Df6W7611879 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:41:06 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53Df6W7611879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559569267; bh=ugDYpScCfry1yiNAFZlLVJ4QEvVOEsD3LZccOBLSkX8=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=SoxBGPZTTDREtENOcZoKx+JKfwOJaSpK/84csvKlXaWf6KpMQlwFT6w0Wa+HOr7P0 4cF06h6SDVJM/SqH/WTNOSxB90YBSyYIroqU/lgRMNoB97/1K8VyfYld7mXiExA+kI NSuT/GvZu2QdYhbx3qJ2CQzU/6UTtUcnTvd3BhEbNy2RHQRVyq+/RhpmQNdMalUZnz kgBfFsouVAFiUcfS/JbBTvpP4612fHldDexBMU5PW+OQ8gBP4ew+TCfIF0tQvHYrIv eEpb2GW2vNdGytj8EeO/HvY2ftKc8dZDyAJcYQpz+SANJ4RaN/HG03EOuVsf3NNdWE /qv1V3QvItU9A== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53Df6of611876; Mon, 3 Jun 2019 06:41:06 -0700 Date: Mon, 3 Jun 2019 06:41:06 -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: tglx@linutronix.de, peterz@infradead.org, will.deacon@arm.com, hpa@zytor.com, palmer@sifive.com, mingo@kernel.org, mark.rutland@arm.com, torvalds@linux-foundation.org, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, hpa@zytor.com, palmer@sifive.com, peterz@infradead.org, will.deacon@arm.com, mark.rutland@arm.com, mingo@kernel.org, aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org In-Reply-To: <20190522132250.26499-12-mark.rutland@arm.com> References: <20190522132250.26499-12-mark.rutland@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/atomic, riscv: Fix atomic64_sub_if_positive() offset argument Git-Commit-ID: 33e42ef571979fe6601ac838d338eb599d842a6d 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=-2.4 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF 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: 33e42ef571979fe6601ac838d338eb599d842a6d Gitweb: https://git.kernel.org/tip/33e42ef571979fe6601ac838d338eb599d842a6d Author: Mark Rutland AuthorDate: Wed, 22 May 2019 14:22:43 +0100 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 12:32:56 +0200 locking/atomic, riscv: Fix atomic64_sub_if_positive() offset argument Presently the riscv implementation of atomic64_sub_if_positive() takes a 32-bit offset value rather than a 64-bit offset value as it should do. Thus, if called with a 64-bit offset, the value will be unexpectedly truncated to 32 bits. Fix this by taking the offset as a long rather than an int. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Palmer Dabbelt Cc: Albert Ou Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon 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: 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-12-mark.rutland@arm.com Signed-off-by: Ingo Molnar --- arch/riscv/include/asm/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h index 9038aeb900a6..9c263bd9d5ad 100644 --- a/arch/riscv/include/asm/atomic.h +++ b/arch/riscv/include/asm/atomic.h @@ -332,7 +332,7 @@ static __always_inline int atomic_sub_if_positive(atomic_t *v, int offset) #define atomic_dec_if_positive(v) atomic_sub_if_positive(v, 1) #ifndef CONFIG_GENERIC_ATOMIC64 -static __always_inline long atomic64_sub_if_positive(atomic64_t *v, int offset) +static __always_inline long atomic64_sub_if_positive(atomic64_t *v, long offset) { long prev, rc;