From patchwork Thu Nov 14 10:49:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 11243507 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCF2113B2 for ; Thu, 14 Nov 2019 10:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D7F82070E for ; Thu, 14 Nov 2019 10:49:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NOcHHWgl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbfKNKtZ (ORCPT ); Thu, 14 Nov 2019 05:49:25 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39804 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfKNKtZ (ORCPT ); Thu, 14 Nov 2019 05:49:25 -0500 Received: by mail-wr1-f68.google.com with SMTP id l7so5891311wrp.6; Thu, 14 Nov 2019 02:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PsHKqqY8IP1kGma0cvoxtMrhEOwaSBiNr+WZYaEGu0g=; b=NOcHHWglfoKO58skQZauX0HJysJ9mN4S6+/mfw7RSDHMs8+6clX4CVpTzVYOz8R7dO rBXc73FjmFa3n3a1Er6eaHQiAew4lci0+BOEzL8aq6lEvv0OVq6tJBqX58wCKBnYfUnN /SeIUC20vxg7pm6jnlJKsf+8rqnfrNqglyC1N2+3zJjmUKpiW/DXD6sCtHuKAV0gxibc LCwmj4J6LiSkPjn0l3YU2aZNkzGpxokdbcZuc2id8DKoQKm9jBjpfgALJ9uyQ9naKv39 NARuO18x4XX2ng9JxlMUgZYrQbscQ3HCnlSrEkXok7fCR9l7bSv0n92PDtqmYd3uruy/ NNrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PsHKqqY8IP1kGma0cvoxtMrhEOwaSBiNr+WZYaEGu0g=; b=uRYDG6k9P92ZbIUGlA3DGyPNx161yhTNDyq6GYCRXgPb1Ve5hA7u3QsPBxDLOoimn+ q9L09+Ji/8UN9/KpZCjVowWZLSZoHgxdjbAQDNOghk+nGVgCDvipXqbfK6JZeYJ0TmFc F8dVYkajoOoeytGH17eXkS9HDHc6xXlxdAi2BpLioXMMdoBiEr67Q3iJ1gI+AP1PACDM i3V3N9tOOicpWTAIiekfbwO99r54e/2vItq5xZ1BMmJBbe6Aw3TGpYwrjUi0nemUH5uM YYNO8B0B9IXaSAtbLprdXZrQu8muH/4awP5KGKve0I7WO+wUBzSuJPyVx+6yOoM2CPgd xr5w== X-Gm-Message-State: APjAAAVemMRJkXtq2Db8/qi0sir+s+N59m2m1r7JVGQSOqOSmqT3Echn 7MpiUhne89vDHthNEOwkALE= X-Google-Smtp-Source: APXvYqzW70DVjuUaihSTDR9YctsEX5FZ+s1gUJ7ISZDeUN6w5dhrMPFEcE91FgX+8CB+6kXYCTA1CA== X-Received: by 2002:a5d:6b51:: with SMTP id x17mr8043604wrw.148.1573728563385; Thu, 14 Nov 2019 02:49:23 -0800 (PST) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k14sm7229301wrw.46.2019.11.14.02.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 02:49:22 -0800 (PST) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH 1/2] crypto: sun4i-ss: Fix 64-bit size_t warnings on sun4i-ss-hash.c Date: Thu, 14 Nov 2019 11:49:06 +0100 Message-Id: <20191114104907.10645-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c index 9930c9ce8971..91cf58db3845 100644 --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c @@ -284,8 +284,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; @@ -305,8 +305,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); @@ -332,8 +332,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; From patchwork Thu Nov 14 10:49:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 11243509 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BEADD913 for ; Thu, 14 Nov 2019 10:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EB31206F0 for ; Thu, 14 Nov 2019 10:49:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gnFcIlbK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726002AbfKNKt0 (ORCPT ); Thu, 14 Nov 2019 05:49:26 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38023 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfKNKt0 (ORCPT ); Thu, 14 Nov 2019 05:49:26 -0500 Received: by mail-wm1-f66.google.com with SMTP id z19so5345427wmk.3; Thu, 14 Nov 2019 02:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NwAeLrKvbbZMMrwnv1eozuX4/GetsOmlDvz+Gto4i+k=; b=gnFcIlbK+7rOK1QioyvQsJIa/QTWL2hkKkzE7GJZbWrUS7WHynwr3Ip67bsIsKiuUf /ZmIr/rM3wyntOQXhvbaUNK94VGUqQ8ltx0wfGiCgVFdll09HDwLZFqsp2QZ9o97IWtN DR5yz1J0s3S5NL6VkMS/jLwmefaM7oUlCI8JbQtfMEVe7I0c9ePaZ4Nhu92BY+3uvZ4i z6dkhcZT2LpvZEEIu8zQRqJtEseC8YuSPbnRRZDw5+EwyyqrMMs0ZAB33SzWiVQiJ8Hu et7fBdtOqMvrfmo4kJKQdgjcyz8CSK8hb4GZNgNZ1UybUgotG9JWv6xMEvRT6uWd0Ppj Aw9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NwAeLrKvbbZMMrwnv1eozuX4/GetsOmlDvz+Gto4i+k=; b=B7arG6CDZBmprqUAxdoct7uPZLlBl5J7lkX2fpKZez7nEutAxSbOvPoDSk/mJJfJzU uJURI4+oZ7Gd46T+schniyHDwZJ1x7jn+unoyDYEB1XEMZKLY495GUWOQRzBPSlNchmj PrHnYmQKgAZJQYKLm5nTfBwwwHCcjUdqmlptR2WGp9exUmcKy0W+Xqqr5546JS49rU49 DO2/U7kiJ6Vb6BvtH7sIyWEoUKca2sTT4XRDcE3MMsCMkNRlFOaBIKbnXLMUavux8gk0 jxaQfdSmeHq5Ma1nebVybi8BkP4P/ESJBjlNyf4keocstHV4ZJfCJAHPDiV45UbIh0W5 5gDQ== X-Gm-Message-State: APjAAAWIk4aejz6RHCU5bHwhM7Waz6bGckVNytrtzVVLoOms+pjb6ONZ JXki3BGlel7RhWQPdWEeDRI= X-Google-Smtp-Source: APXvYqz0PO/gUjWxdhePfi47Eljly0FCq+XLQE5Tvm4jyTpgfS8z6n7vRDQBxoW13zSWJU/D0T5RLg== X-Received: by 2002:a1c:dc09:: with SMTP id t9mr7014332wmg.65.1573728564499; Thu, 14 Nov 2019 02:49:24 -0800 (PST) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k14sm7229301wrw.46.2019.11.14.02.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 02:49:24 -0800 (PST) From: Corentin Labbe To: davem@davemloft.net, herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH 2/2] crypto: sun4i-ss: remove dependency on not 64BIT Date: Thu, 14 Nov 2019 11:49:07 +0100 Message-Id: <20191114104907.10645-2-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191114104907.10645-1-clabbe.montjoie@gmail.com> References: <20191114104907.10645-1-clabbe.montjoie@gmail.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The driver now compile without warnings on 64bits, we can remove the !64BIT condition. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/allwinner/Kconfig b/drivers/crypto/allwinner/Kconfig index b3c9c34a30de..b0a5a0827483 100644 --- a/drivers/crypto/allwinner/Kconfig +++ b/drivers/crypto/allwinner/Kconfig @@ -7,7 +7,7 @@ config CRYPTO_DEV_ALLWINNER config CRYPTO_DEV_SUN4I_SS tristate "Support for Allwinner Security System cryptographic accelerator" - depends on ARCH_SUNXI && !64BIT + depends on ARCH_SUNXI depends on PM depends on CRYPTO_DEV_ALLWINNER select CRYPTO_MD5