From patchwork Wed May 22 13:22:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 164833 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp861551ili; Wed, 22 May 2019 06:25:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiboPRky3vmI3G2HwXHtubVN9CHpNa+UzlYNZrIlkT8HARDl+3ml/11ysXf2yoTvMWkm7p X-Received: by 2002:a65:528b:: with SMTP id y11mr89700248pgp.341.1558531539457; Wed, 22 May 2019 06:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531539; cv=none; d=google.com; s=arc-20160816; b=uBYXb5WVoR2rf/au97A9KeRVLqpMqryjGZWLa9lgdJwR4+3BdHtRKOri7d1UzQTLqf 3z5JAoO8gyHhq9sf7n0dwaIPgpIZz0/U7hP5S2VdLdpUGOm64O0foM20mYDTmbrsgfhv 6aL28VPv+Lzkfpa/pKBGUXWPf8PwToY59hvFecCon0uHgQ0STcYssq3h78EKXzwFQPCM gr58dirYmDlu0nR3K2Tpvfrp8L6DhhYkY1PqHRQgz3aWNVa//nND+D5qemMT7LScJez6 9nhnHuKe4HYd6MT2EEEdYWnkboxKY3ECOcj96+PXQadxbxH2nvsfoXNh7oDSm0ZA3Wzf RYlg== 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=uvLwWdq/ZFQWuLsL40+AXLsBRBRkiPlvdkrZQpSLUNwNdKafoxJxkpdeGyduqO8nRY lkyYnuJWTgWmyvM2c0ZqYLjJNdoM+1h2tJgC6XyMLGV2d/mwPc84CnM7OI5DeKyKybFu yclz7KEQY3X+XtJ5iDSdmGn7itRYC6YQT4wl0Ll3ZZVrHSJQpXpuMYr2/8g1dZemr9rY hhiTi4GvxT4zsrqsiDWOGT8yikNP94Q3Te/QaWpvNyZSZz7K2mfPwd8I/tXGw9Tgos4m W07VQLz09wrpzKv9xDpU3lcttPgrGdwpl+l7c9BSbYjmxei6VCMQknL/JCPzQhF4al+f p30g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 w190si23724273pgd.577.2019.05.22.06.25.39; Wed, 22 May 2019 06:25:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729172AbfEVNZi (ORCPT + 14 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.11.0 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