MLK-18044-2: crypto: caam: Fix build warnings pointer casting
authorAymen Sghaier <aymen.sghaier@nxp.com>
Tue, 1 May 2018 16:42:21 +0000 (18:42 +0200)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:29:16 +0000 (02:29 -0700)
  Enabling CAAM driver for i.MX8M platforms, a 64 bits architecture,
 lead to casting warnings: from/to pointer to/from integer with
 different size. This patch fix these warnings

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit d02fbc7d2957f4788ced017ccf17fd35ab968121)
(cherry picked from commit 79e90af14af32e86fd7efd3c84e09a0bd572ab5b)

drivers/crypto/fsl/jr.c
include/fsl_sec.h

index 9d56f08..644c760 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2008-2014 Freescale Semiconductor, Inc.
+ * Copyright 2018 NXP
  *
  * Based on CAAM driver in drivers/crypto/caam in Linux
  */
@@ -27,10 +28,10 @@ uint32_t sec_offset[CONFIG_SYS_FSL_MAX_NUM_OF_SEC] = {
 };
 
 #define SEC_ADDR(idx)  \
-       ((CONFIG_SYS_FSL_SEC_ADDR + sec_offset[idx]))
+       (ulong)((CONFIG_SYS_FSL_SEC_ADDR + sec_offset[idx]))
 
 #define SEC_JR0_ADDR(idx)      \
-       (SEC_ADDR(idx) +        \
+       (ulong)(SEC_ADDR(idx) + \
         (CONFIG_SYS_FSL_JR0_OFFSET - CONFIG_SYS_FSL_SEC_OFFSET))
 
 struct jobring jr0[CONFIG_SYS_FSL_MAX_NUM_OF_SEC];
index efc510c..d503852 100644 (file)
@@ -13,8 +13,8 @@
 #include <asm/io.h>
 
 #ifdef CONFIG_SYS_FSL_SEC_LE
-#define sec_in32(a)       in_le32(a)
-#define sec_out32(a, v)   out_le32(a, v)
+#define sec_in32(a)       in_le32((ulong *)(ulong)a)
+#define sec_out32(a, v)   out_le32((ulong *)(ulong)a, v)
 #define sec_in16(a)       in_le16(a)
 #define sec_clrbits32     clrbits_le32
 #define sec_setbits32     setbits_le32