From patchwork Sun Dec 29 17:19:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182547 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5453631ild; Sun, 29 Dec 2019 09:38:04 -0800 (PST) X-Google-Smtp-Source: APXvYqw4dz+O6we49roeSomJMgzF0Iqwnf2gxyqcYHT3b3wniFm2O5bGz177s/b5x292YEbTvA4q X-Received: by 2002:a05:6830:1402:: with SMTP id v2mr58432168otp.12.1577641084231; Sun, 29 Dec 2019 09:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641084; cv=none; d=google.com; s=arc-20160816; b=ISkHbhs8JIuyBlqPZLf0ecY8hVtlv5FvuGvdtJDXw7XQry3xxbjvK12PZiuan92yh3 f6QiiTyFcnUReP84ixhgqM8Uk/0cSVhjU4D19St6i8qg9lq6iwPQBmuYoKvMMXMbOY4j krmjAG1OQDdLCxTt3FsZ5t0ptCe8WDPrNGWXfW0BeSqQpytGHnwzF026s3Orrk5FDZJK /OT9k/mkjbYQK4UAIjM2tMIF9bdnAgbMHWcjW3Vqvv+5MP++65p/nlDLNaxmWYBW2PCO AfdMNXWPedcUPd6f8gifFHzcKwFroBD9qkn86qbPpqh/ZJb3B6BHuMrktub64ml1ko1t PXNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZFRapnysdZ32zH+Fs4tBt5UNKzpkUBx2KcyDvOFTrXI=; b=jq0Ckz6901hnHbr/lvNxUtR/mCuNSgnwPQShPJkDt7DtaySlpAVMjz4JwS48OehKBv 95TBZO9FuhVgZvYFJLGu9sHZQHUoXprMdjlexEHpL7gwXhMUrXcXxJbbEuzu7MahS15E SH/yuk/pQplKzRlF0jwPdylYZPVrpltH4V6Xo/WKgexmm/VfkCwfZ8Rarcv7ChaLzU20 mCHUinWyHLvstW2ppnIBBJNIlIWl8Ev5AKLJnwtcqxRNLfavndzsjC0PDc44YBhTjp6B WFjW+PeXg4NQPnviSrZj7xCIyLL1ylL0163ZLkCNSYbw/DW1mCx9BtfRGTfScTV3GLq5 F1gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=onP9yjqS; 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 l20si21105276otr.227.2019.12.29.09.38.04; Sun, 29 Dec 2019 09:38:04 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=onP9yjqS; 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 S1729980AbfL2RiD (ORCPT + 27 others); Sun, 29 Dec 2019 12:38:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:38438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbfL2Res (ORCPT ); Sun, 29 Dec 2019 12:34:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9FA120722; Sun, 29 Dec 2019 17:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640888; bh=wTeLpwQ9NyWe9Ik7bwUjxLI73XPOTIwTnGzR5hpahyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=onP9yjqSiRoaTnOZqyumPmVd5Z55gYwJXJHbNVBiybQKsaO3QlEr44/IMQ76Mevpy 1rrIxva3OYWUG9Ta5BoYrHcc4bJmlxtdcuiqBo8eCI1F1zivJHDJuZn35ou67MyYiT w6erUdWmGx31ueDlWO9EPiaGJH3iZznL+2pZSN3M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 4.19 181/219] crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c Date: Sun, 29 Dec 2019 18:19:43 +0100 Message-Id: <20191229162536.490846003@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Corentin Labbe [ Upstream commit a7126603d46fe8f01aeedf589e071c6aaa6c6c39 ] If you try to compile this driver on a 64-bit platform then you will get warnings because it mixes size_t with unsigned int which only works on 32-bit. This patch fixes all of the warnings on sun4i-ss-hash.c. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index f6936bb3b7be..1a724263761b 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -276,8 +276,8 @@ static int sun4i_hash(struct ahash_request *areq) */ while (op->len < 64 && i < end) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, end - i, - 64 - op->len); + in_r = min(end - i, 64 - op->len); + in_r = min_t(size_t, mi.length - in_i, in_r); memcpy(op->buf + op->len, mi.addr + in_i, in_r); op->len += in_r; i += in_r; @@ -297,8 +297,8 @@ static int sun4i_hash(struct ahash_request *areq) } if (mi.length - in_i > 3 && i < end) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, areq->nbytes - i, - ((mi.length - in_i) / 4) * 4); + in_r = min_t(size_t, mi.length - in_i, areq->nbytes - i); + in_r = min_t(size_t, ((mi.length - in_i) / 4) * 4, in_r); /* how many bytes we can write in the device*/ todo = min3((u32)(end - i) / 4, rx_cnt, (u32)in_r / 4); writesl(ss->base + SS_RXFIFO, mi.addr + in_i, todo); @@ -324,8 +324,8 @@ static int sun4i_hash(struct ahash_request *areq) if ((areq->nbytes - i) < 64) { while (i < areq->nbytes && in_i < mi.length && op->len < 64) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, areq->nbytes - i, - 64 - op->len); + in_r = min(areq->nbytes - i, 64 - op->len); + in_r = min_t(size_t, mi.length - in_i, in_r); memcpy(op->buf + op->len, mi.addr + in_i, in_r); op->len += in_r; i += in_r;