From patchwork Wed May 22 13:22:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 164818 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp859265ili; Wed, 22 May 2019 06:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3milO2Ab95kQkE8SxrJ4eauopluuRmbUK1wP8GxbhJ0FEtZwYWyQCi3f/DUnixwWsp71D X-Received: by 2002:a63:f703:: with SMTP id x3mr87791530pgh.394.1558531418679; Wed, 22 May 2019 06:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531418; cv=none; d=google.com; s=arc-20160816; b=QegZOWUv9fEBTtJcKPvURFYCFJk2qdGdy9urt68qsESUPun3dPWeRjsmhoIlu92NB6 +uMpM60kukRzwRjao0CxG8VDxIzu/HMRaa4vz18l6cvrQOwzIBonB0v5srTCQXBPQlwM 1TUwet6OyNtP9d8LkbT71XJ4x11A4+oAGZV6sgBsa6oH8wvp7iKqN36m+twgV0ZU+27Z /M/1PvSGPecEb9RHabEMfEgd8vLbTIWczUGDk3koBgaNoB/N+++2HOEq6YaATQpHY+jQ TkWOB/es06TYsC580Si5vnIrsUOopEt/2yqr3YIsMl9xr8Px3PBpD5zBBJedLIbZJKgn C9iQ== 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=mV6njZTpYRiZRiM46p548NSYY2BB4B1wGL0oB6HHrDI=; b=nRW9DdYpZrrlzrSsu3qIDP25ULTzaUDOIKUYJ+LrIk0YSRbPGf6BkJbUrwYNJ7GLiI 9XDWMEn+dydWGMynz+qb5zkk3LO4aVLwAJSVHzIX55TfPDiy1gWolELRoPxyaokbgNME wxV+Yd3EVMBsw8xbEidYdZjrr/1mWnYlE+WiJQWmCf8PbcNC/SOnl522YeHEY1XdU14y ns/YkGtF+6ZekhxuLRnwenRpLEw2JGpBFGdroE4xxZMYl1J2q02BYnravoaaCH/PNSvx 7h+U1huF70dxWgmN95Qm71ZZ7dgCy0G0KK8XnzUC8jCPxnHaNK4sPbmI8928ZV4MHefd 1d/Q== 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 z143si27821199pfc.38.2019.05.22.06.23.38; Wed, 22 May 2019 06:23:38 -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 S1729361AbfEVNXh (ORCPT + 14 others); Wed, 22 May 2019 09:23:37 -0400 Received: from foss.arm.com ([217.140.101.70]:50502 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728827AbfEVNXh (ORCPT ); Wed, 22 May 2019 09:23:37 -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 5C86F80D; Wed, 22 May 2019 06:23: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 1CF133F575; Wed, 22 May 2019 06:23:32 -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 01/18] locking/atomic: crypto: nx: prepare for atomic64_read() conversion Date: Wed, 22 May 2019 14:22:33 +0100 Message-Id: <20190522132250.26499-2-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 The return type of atomic64_read() varies by architecture. It may return long (e.g. powerpc), long long (e.g. arm), or s64 (e.g. x86_64). This is somewhat painful, and mandates the use of explicit casts in some cases (e.g. when printing the return value). To ameliorate matters, subsequent patches will make the atomic64 API consistently use s64. As a preparatory step, this patch updates the nx-842 code to treat the return value of atomic64_read() as s64, using explicit casts. These casts will be removed once the s64 conversion is complete. Signed-off-by: Mark Rutland Cc: Herbert Xu Cc: Peter Zijlstra Cc: Will Deacon --- drivers/crypto/nx/nx-842-pseries.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c index 57932848361b..9432e9e42afe 100644 --- a/drivers/crypto/nx/nx-842-pseries.c +++ b/drivers/crypto/nx/nx-842-pseries.c @@ -869,8 +869,8 @@ static ssize_t nx842_##_name##_show(struct device *dev, \ rcu_read_lock(); \ local_devdata = rcu_dereference(devdata); \ if (local_devdata) \ - p = snprintf(buf, PAGE_SIZE, "%ld\n", \ - atomic64_read(&local_devdata->counters->_name)); \ + p = snprintf(buf, PAGE_SIZE, "%lld\n", \ + (s64)atomic64_read(&local_devdata->counters->_name)); \ rcu_read_unlock(); \ return p; \ } @@ -922,17 +922,17 @@ static ssize_t nx842_timehist_show(struct device *dev, } for (i = 0; i < (NX842_HIST_SLOTS - 2); i++) { - bytes = snprintf(p, bytes_remain, "%u-%uus:\t%ld\n", + bytes = snprintf(p, bytes_remain, "%u-%uus:\t%lld\n", i ? (2<<(i-1)) : 0, (2<