linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@nxp.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	Aymen Sghaier <aymen.sghaier@nxp.com>,
	Franck Lenormand <franck.lenormand@nxp.com>,
	Dan Douglass <dan.douglass@nxp.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	NXP Linux Team <linux-imx@nxp.com>
Subject: [PATCH 1/7] crypto: caam - remove deadcode on 32-bit platforms
Date: Wed, 22 Jul 2020 15:14:52 +0300	[thread overview]
Message-ID: <20200722121458.8478-2-horia.geanta@nxp.com> (raw)
In-Reply-To: <20200722121458.8478-1-horia.geanta@nxp.com>

From: Franck LENORMAND <franck.lenormand@nxp.com>

When building on a platform with a 32bit DMA address, taking the
upper 32 bits makes no sense.

Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
---
 drivers/crypto/caam/regs.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
index 0f810bc13b2b..af61f3a2c0d4 100644
--- a/drivers/crypto/caam/regs.h
+++ b/drivers/crypto/caam/regs.h
@@ -173,9 +173,14 @@ static inline u64 rd_reg64(void __iomem *reg)
 
 static inline u64 cpu_to_caam_dma64(dma_addr_t value)
 {
-	if (caam_imx)
-		return (((u64)cpu_to_caam32(lower_32_bits(value)) << 32) |
-			 (u64)cpu_to_caam32(upper_32_bits(value)));
+	if (caam_imx) {
+		u64 ret_val = (u64)cpu_to_caam32(lower_32_bits(value)) << 32;
+
+		if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))
+			ret_val |= (u64)cpu_to_caam32(upper_32_bits(value));
+
+		return ret_val;
+	}
 
 	return cpu_to_caam64(value);
 }
-- 
2.17.1


  reply	other threads:[~2020-07-22 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 12:14 [PATCH 0/7] crypto: caam - updates for 5.9 Horia Geantă
2020-07-22 12:14 ` Horia Geantă [this message]
2020-07-22 12:14 ` [PATCH 2/7] crypto: caam/qi2 - fix error reporting for caam_hash_alloc Horia Geantă
2020-07-22 12:14 ` [PATCH 3/7] crypto: caam/qi2 - create ahash shared descriptors only once Horia Geantă
2020-07-22 12:14 ` [PATCH 4/7] crypto: caam - silence .setkey in case of bad key length Horia Geantă
2020-07-22 12:14 ` [PATCH 5/7] crypto: caam/jr - remove incorrect reference to caam_jr_register() Horia Geantă
2020-07-22 12:14 ` [PATCH 6/7] crypto: caam - add more RNG hw error codes Horia Geantă
2020-07-22 12:25   ` Horia Geantă
2020-07-22 12:14 ` [PATCH 7/7] crypto: caam/qi2 - add module alias Horia Geantă
2020-07-31 13:30 ` [PATCH 0/7] crypto: caam - updates for 5.9 Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200722121458.8478-2-horia.geanta@nxp.com \
    --to=horia.geanta@nxp.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=dan.douglass@nxp.com \
    --cc=davem@davemloft.net \
    --cc=franck.lenormand@nxp.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).