From patchwork Sun Dec 29 17:19:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182538 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5443731ild; Sun, 29 Dec 2019 09:26:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwoO2QmqV7Nlub2in8zB+dGiP8JwSaFBVn8z/yIXjoqDRoJTrN2cB+91O7d3BL7EWHmyhsy X-Received: by 2002:a9d:588d:: with SMTP id x13mr65865043otg.6.1577640374101; Sun, 29 Dec 2019 09:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577640374; cv=none; d=google.com; s=arc-20160816; b=LFElsHov0Hblz8WVFpZfry1bTFZjKl9WZj4cl4fwun4/oeqhZSLylc14SD+B3UyDOz zmWmuVk9IC++y4e4feQDbPBIN1a+x325Zl5iyloWcsY+p7gFQs4jQtEDEUogXpcQ0diJ pFOhRtKk7EzE68yRj2/wQ8JmvawA3WeNuY90Fy7jHIxPD0qtwB9w1gy4sdc1jEi9cxdn zktHShQv60vLXgnVI+hUOtEtwVp1S9MIfARJheVjQFd6Ioy8yALB0KWT14pnQmwO5h5g tilbE3Pzth3mn9s49G7feNCy4LeMGptDyjZJu3I9rL7J79sDihL54BfhOFloCIxxUJfN 8kow== 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=UhpemRsD36OlnY6p0DSsRHyY1HGnNyV/MS6dsFStl21TArPhRw3Z8LKE5sYojpgcDl J+IispXmCDgcgUunJu9JDlWquZ1l6In/k4gq11rWTL9hD6Kg+7mSqxBH26uMu+1uLM5E zeP5fBRWZXoJM/nPjrQ/YszML6LplR6SmDMA3h6JCYkg7rEjny5SL7RsYsBUP7PmAidx nnvdn3R0qyWVdIh6Zn7+LUeRMLAcfiVzigahRnhGXsvjDxnkDbWSb8jfRW88UhUgYM0n asLPPCQCmyctm/rqf+rnqC0ImpyVTOq31mmq2eHcUTT0vPc1EXYiOG6YJAi0rAxEqM4C 2dzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WSAQ2+O0; 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 q127si18794403oic.99.2019.12.29.09.26.13; Sun, 29 Dec 2019 09:26:14 -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=WSAQ2+O0; 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 S1728144AbfL2R0M (ORCPT + 27 others); Sun, 29 Dec 2019 12:26:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:46838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728123AbfL2R0I (ORCPT ); Sun, 29 Dec 2019 12:26:08 -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 DF0A5207FF; Sun, 29 Dec 2019 17:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640368; bh=wTeLpwQ9NyWe9Ik7bwUjxLI73XPOTIwTnGzR5hpahyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WSAQ2+O0qTPSgM0I62BcDSK7Jtx0Y1SdWN9NQ1SS2I7S+9AF3aQEFS5Z3rCtt2F1w l8Ww2TQzHjcFCB+fKDV52sGwPHKfAWdg/TTm7Ok4cTursDK9QTSDQXtOzpoi2qA2Xh HT46jRiLmP6BPagdW6IdCBVQVtsbhdp+Mmk4diKQ= 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.14 130/161] crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c Date: Sun, 29 Dec 2019 18:19:38 +0100 Message-Id: <20191229162438.205997055@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@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;