Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp470291ybm; Wed, 22 May 2019 06:25:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR0QdtZQIwbFWjnfMt3e8/biLKLrh0klB6nnQKt9BPkdKE8aRVBmtbT4E+x+heaNRgn9LT X-Received: by 2002:a65:6648:: with SMTP id z8mr40970962pgv.303.1558531512229; Wed, 22 May 2019 06:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558531512; cv=none; d=google.com; s=arc-20160816; b=A4Hpi3K4CnvszNrCbglRrnLU8CMkHrSBRio4g8+ProoaTEuGLuuf7fuKxRcn7ZPtbY 2ygWs5dp2LwUKasvNbzx8jKeSWYzIFZmheqB6RJyng+hekDXc4/eyYI7mbOH2zq9kd7H WlgfZX8onGgablva2Bxl9jLpnow+apVjXKNcsPhucGnAB+JQjcCc74sKFVoKwOMxupQd YYW9LewlEDhZFcCOVqE5iklLMXl08rfSGXAyuCrms+h2dypFu7gHRN4i/tAd4maL7haJ 7RscyUQlqrHZlHvQ0J5AAsIA8JWRRRXAk/I6IDso4/g6N5ygWH57N0awO/JXLqH13o6H 37Jw== 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=g72X+EKmshTSUnj0JiQ9N2tYdFq5WpQy4yE4OitrYSePFrBsvcFbHLzRB1rtUArMrw UEsEORnHcCDULTYPhV7mU8LANgXfnNpAcxpmL6gumIQRk6SfSQBevFKZmo+Sb9dZLB/B d4U2oaY3trTb+XzXwHG2RpwK3lNMrNdAgZPbE5ji+aBk1XIu7rR/8m0W4eq8F2BBuXAa nzsQCLCkOu2J0oWPdUbwpbZ++6rdRxAIiFvWg6f9BAnqiXXM6LfcYCutzY6pMXDXoxK1 W2HbbRnqxDyIgBYRLA3+PEnMIKPTIAGBrUDRHXA0jVEthXOyZiYgFC7k/QFxT9ovrnY7 DPbA== 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 v12si2575785pgn.374.2019.05.22.06.24.56; Wed, 22 May 2019 06:25:12 -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 S1729457AbfEVNXi (ORCPT + 99 others); Wed, 22 May 2019 09:23:38 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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<