Skip to content

Commit 81f2288

Browse files
lenormandfranckherbertx
authored andcommitted
crypto: caam - remove deadcode on 32-bit platforms
When building on a platform with a 32bit DMA address, taking the upper 32 bits makes no sense. Signed-off-by: Franck LENORMAND <[email protected]> Signed-off-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f892a21 commit 81f2288

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/crypto/caam/regs.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,14 @@ static inline u64 rd_reg64(void __iomem *reg)
173173

174174
static inline u64 cpu_to_caam_dma64(dma_addr_t value)
175175
{
176-
if (caam_imx)
177-
return (((u64)cpu_to_caam32(lower_32_bits(value)) << 32) |
178-
(u64)cpu_to_caam32(upper_32_bits(value)));
176+
if (caam_imx) {
177+
u64 ret_val = (u64)cpu_to_caam32(lower_32_bits(value)) << 32;
178+
179+
if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT))
180+
ret_val |= (u64)cpu_to_caam32(upper_32_bits(value));
181+
182+
return ret_val;
183+
}
179184

180185
return cpu_to_caam64(value);
181186
}

0 commit comments

Comments
 (0)