1 From 4269eb560ac34c5974559fe256811c1ac5d764ed Mon Sep 17 00:00:00 2001
2 From: Franck LENORMAND <franck.lenormand@nxp.com>
3 Date: Fri, 23 Nov 2018 16:06:45 +0100
4 Subject: [PATCH] MLK-20204 crypto: caam - remove deadcode on 32-bit platforms
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 When building on a platform with a 32bit DMA address, taking the
10 upper 32 bits makes no sense.
12 Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
13 (cherry picked from commit d3346aaa3fbfaf9b7f827d8554f076e3fc82c35b)
15 -replace ifdeffery with IS_ENABLED() macro
16 -change commit headline prefix
18 Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
20 drivers/crypto/caam/regs.h | 11 ++++++++---
21 1 file changed, 8 insertions(+), 3 deletions(-)
23 --- a/drivers/crypto/caam/regs.h
24 +++ b/drivers/crypto/caam/regs.h
25 @@ -173,9 +173,14 @@ static inline u64 rd_reg64(void __iomem
27 static inline u64 cpu_to_caam_dma64(dma_addr_t value)
30 - return (((u64)cpu_to_caam32(lower_32_bits(value)) << 32) |
31 - (u64)cpu_to_caam32(upper_32_bits(value)));
33 + u64 ret_val = (u64)cpu_to_caam32(lower_32_bits(value)) << 32;
35 + if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))
36 + ret_val |= (u64)cpu_to_caam32(upper_32_bits(value));
41 return cpu_to_caam64(value);