From patchwork Fri Jan 8 11:24:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 7984611 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42909BEEE5 for ; Fri, 8 Jan 2016 11:25:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C6B220108 for ; Fri, 8 Jan 2016 11:25:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70C0420103 for ; Fri, 8 Jan 2016 11:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687AbcAHLYf (ORCPT ); Fri, 8 Jan 2016 06:24:35 -0500 Received: from foss.arm.com ([217.140.101.70]:44596 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbcAHLYd (ORCPT ); Fri, 8 Jan 2016 06:24:33 -0500 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 10F023A8; Fri, 8 Jan 2016 03:24:00 -0800 (PST) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB3ED3F24D; Fri, 8 Jan 2016 03:24:31 -0800 (PST) From: Andre Przywara To: Corentin Labbe , Maxime Ripard , Chen-Yu Tsai , Arnd Bergmann Cc: Herbert Xu , "David S . Miller" , linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [RESEND PATCH 1/2] crypto: sunxi-ss-cipher: promote variables to match types in min3() calls Date: Fri, 8 Jan 2016 11:24:08 +0000 Message-Id: <1452252249-12040-2-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1452252249-12040-1-git-send-email-andre.przywara@arm.com> References: <1452252249-12040-1-git-send-email-andre.przywara@arm.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP (resending to add linux-crypto, patch unchanged) The min3() macro expects all arguments to be of the same type (or size at least). Change the type of some local variables in sun4i-ss-cipher.c to size_t to match the type used in some generic structures we compare against. That shouldn't change anything for 32-bit (as size_t is unsigned int there anyway), but allows compilation for 64-bit architectures. Signed-off-by: Andre Przywara --- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index a19ee12..707f30f 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c @@ -25,13 +25,13 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq) struct sun4i_cipher_req_ctx *ctx = ablkcipher_request_ctx(areq); u32 mode = ctx->mode; /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */ - u32 rx_cnt = SS_RX_DEFAULT; - u32 tx_cnt = 0; + size_t rx_cnt = SS_RX_DEFAULT; + size_t tx_cnt = 0; u32 spaces; u32 v; int i, err = 0; - unsigned int ileft = areq->nbytes; - unsigned int oleft = areq->nbytes; + size_t ileft = areq->nbytes; + size_t oleft = areq->nbytes; unsigned int todo; struct sg_mapping_iter mi, mo; unsigned int oi, oo; /* offset for in and out */ @@ -134,13 +134,13 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq) struct sun4i_cipher_req_ctx *ctx = ablkcipher_request_ctx(areq); u32 mode = ctx->mode; /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */ - u32 rx_cnt = SS_RX_DEFAULT; - u32 tx_cnt = 0; + size_t rx_cnt = SS_RX_DEFAULT; + size_t tx_cnt = 0; u32 v; u32 spaces; int i, err = 0; - unsigned int ileft = areq->nbytes; - unsigned int oleft = areq->nbytes; + size_t ileft = areq->nbytes; + size_t oleft = areq->nbytes; unsigned int todo; struct sg_mapping_iter mi, mo; unsigned int oi, oo; /* offset for in and out */ @@ -148,7 +148,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq) char bufo[4 * SS_TX_MAX]; /* buffer for linearize SG dst */ unsigned int ob = 0; /* offset in buf */ unsigned int obo = 0; /* offset in bufo*/ - unsigned int obl = 0; /* length of data in bufo */ + size_t obl = 0; /* length of data in bufo */ if (areq->nbytes == 0) return 0; @@ -251,7 +251,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq) spaces = readl(ss->base + SS_FCSR); rx_cnt = SS_RXFIFO_SPACES(spaces); tx_cnt = SS_TXFIFO_SPACES(spaces); - dev_dbg(ss->dev, "%x %u/%u %u/%u cnt=%u %u/%u %u/%u cnt=%u %u %u\n", + dev_dbg(ss->dev, "%x %u/%zu %zu/%u cnt=%zu %u/%zu %zu/%u cnt=%zu %u %u\n", mode, oi, mi.length, ileft, areq->nbytes, rx_cnt, oo, mo.length, oleft, areq->nbytes, tx_cnt,