Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp473503ybm; Wed, 22 May 2019 06:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXknz3uOnJfuThredB2/axRAHfFW+UAV/L05w3R66K+dklnpQKb7yfIiMYjbalzOfATKZ0 X-Received: by 2002:a65:608a:: with SMTP id t10mr89152033pgu.155.1558531712249; Wed, 22 May 2019 06:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531712; cv=none; d=google.com; s=arc-20160816; b=WJWPc6c/JJS3CbC+T2wAF6ps6RhEjUzzYALkl8ippXpm34bxouqGVnnE7w7nJ9Gafo NlyEwWdoJurbcGKCtmkhrr9RxCwaSsTxZa3T7ZUELTmxiKT7dMY/47XfbH/Hi/dJMOyW /vgg5pDpear8apYiinDEXexYMOMwHDaW2N55TlAl2tB3Ypt/sGSM4P3DTXosKJTQt+NI 9cHVyf92nk+43v9REYu0UKPO0y0kCRvb7Dqw6oNzq8gC1ULl8Cn78FGgDw7M/06YEkaX psRYgRHVz+UMx9u9UwU0RcHJIvwkk80Z7PLRuAkrb+1NQvS0iQ32gUXVU2W1nVp8omx7 +Wog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=3cLhS5YE7oHY499LDkY0VYmxsbWa7IVymm4wdUWvrnE=; b=VphQFuYNKvNLooVwOqGlpPhtodp2zg97RRzHHeLi0/Hi0AP5KOuC3m8WAyNMFjBsEv NDlxeAe75SIM9wfxPl54koxLjjPHfnsaY3f2J7B4BU4DZgvTV+TUKJ7u5dN1xNoVl3CA lP1Fq0Wfc2Lz69l5JWAxfTrBuU5fyNObMwKT0/FOyga7LnS7obCuLo2QU5J+btRk7krD q18SGEE7iY8R1M0ZMPY3Tu7OfXI2Ls5ZKw0Bs05T8xD7fZ17tPoVWdQ21kKUMiPTMzsT S9ilyh/ey4tu+hiB6xL1lirjx19JvsbYDoLk4btHX26Y8sgiFWIrZNWLmR4H5EMhIGWG bAQA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si26390820pgj.87.2019.05.22.06.28.17; Wed, 22 May 2019 06:28:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbfEVNZi (ORCPT + 99 others); Wed, 22 May 2019 09:25:38 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51290 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbfEVNZi (ORCPT ); Wed, 22 May 2019 09:25:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F1C9415AB; Wed, 22 May 2019 06:25:37 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A90103F575; Wed, 22 May 2019 06:25:33 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org, peterz@infradead.org, will.deacon@arm.com Cc: aou@eecs.berkeley.edu, arnd@arndb.de, bp@alien8.de, catalin.marinas@arm.com, davem@davemloft.net, fenghua.yu@intel.com, heiko.carstens@de.ibm.com, herbert@gondor.apana.org.au, ink@jurassic.park.msu.ru, jhogan@kernel.org, linux@armlinux.org.uk, mark.rutland@arm.com, mattst88@gmail.com, mingo@kernel.org, mpe@ellerman.id.au, palmer@sifive.com, paul.burton@mips.com, paulus@samba.org, ralf@linux-mips.org, rth@twiddle.net, stable@vger.kernel.org, tglx@linutronix.de, tony.luck@intel.com, vgupta@synopsys.com Subject: [PATCH 16/18] locking/atomic: use s64 for atomic64_t on 64-bit Date: Wed, 22 May 2019 14:22:48 +0100 Message-Id: <20190522132250.26499-17-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190522132250.26499-1-mark.rutland@arm.com> References: <20190522132250.26499-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Peter Zijlstra Cc: Will Deacon --- include/linux/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.11.0