[PATCH 02/18] crypto: caam - fix warning in APPEND_MATH_IMM_u64

Marcin Niestroj m.niestroj at grinn-global.com
Mon Sep 3 04:44:36 PDT 2018


Pick commit c1f2cd21ed5335bfcf5dd1d3a05a2a83bae14c3a from Linux
upstream.

    crypto: caam - fix warning in APPEND_MATH_IMM_u64

    An implicit truncation is done when using a variable of 64 bits
    in MATH command:

    warning: large integer implicitly truncated to unsigned type [-Woverflow]

    Silence the compiler by feeding it with an explicit truncated value.

    Signed-off-by: Tudor Ambarus <tudor.ambarus at freescale.com>
    Signed-off-by: Horia Geant? <horia.geanta at freescale.com>
    Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>

Signed-off-by: Marcin Niestroj <m.niestroj at grinn-global.com>
---
 drivers/crypto/caam/desc_constr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h
index 9f79fd7bd..c06ee734d 100644
--- a/drivers/crypto/caam/desc_constr.h
+++ b/drivers/crypto/caam/desc_constr.h
@@ -367,7 +367,7 @@ do { \
 	if (upper) \
 		append_u64(desc, data); \
 	else \
-		append_u32(desc, data); \
+		append_u32(desc, lower_32_bits(data));	\
 } while (0)
 
 #define append_math_add_imm_u64(desc, dest, src0, src1, data) \
-- 
2.18.0




More information about the barebox mailing list