arm: nexell: fix type casting warning
authorJaewon Kim <jaewon02.kim@samsung.com>
Thu, 18 May 2017 07:03:35 +0000 (16:03 +0900)
committerJaewon Kim <jaewon02.kim@samsung.com>
Fri, 19 May 2017 02:09:20 +0000 (11:09 +0900)
Compile Warning Message
- cast from pointer to integer of different size [-Wpointer-to-int-cast]

This patch adds (uintptr_t) type casting
to change pointer variable to u32.

Change-Id: I9424b826d7818830e3c86612cfbcd82775238d44
Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
arch/arm/mach-nexell/nx_sec_reg.c

index a6b522cbdc831f46b9c420af88a42c022c70c976..c5e6151a17f2d941aee0ef01c67226b61b5f8eeb 100644 (file)
@@ -5,6 +5,7 @@
  * SPDX-License-Identifier:      GPL-2.0+
  */
 
+#include <common.h>
 #include <linux/types.h>
 #include <asm/io.h>
 #include <asm/arch/nexell.h>
@@ -34,10 +35,10 @@ int write_sec_reg_by_id(void __iomem *reg, int val, int id)
                case NEXELL_L2C_SEC_ID:
                case NEXELL_MIPI_SEC_ID:
                case NEXELL_TOFF_SEC_ID:
-                       off = (u32)reg & SEC_4K_OFFSET;
+                       off = (u32)(uintptr_t)reg & SEC_4K_OFFSET;
                        break;
                case NEXELL_MALI_SEC_ID:
-                       off = (u32)reg & SEC_64K_OFFSET;
+                       off = (u32)(uintptr_t)reg & SEC_64K_OFFSET;
                        break;
        }
        ret = __invoke_nexell_fn_smc(NEXELL_SMC_SEC_REG_WRITE |
@@ -53,10 +54,10 @@ int read_sec_reg_by_id(void __iomem *reg, int id)
                case NEXELL_L2C_SEC_ID:
                case NEXELL_MIPI_SEC_ID:
                case NEXELL_TOFF_SEC_ID:
-                       off = (u32)reg & SEC_4K_OFFSET;
+                       off = (u32)(uintptr_t)reg & SEC_4K_OFFSET;
                        break;
                case NEXELL_MALI_SEC_ID:
-                       off = (u32)reg & SEC_64K_OFFSET;
+                       off = (u32)(uintptr_t)reg & SEC_64K_OFFSET;
                        break;
        }
        ret = __invoke_nexell_fn_smc(NEXELL_SMC_SEC_REG_READ |
@@ -68,13 +69,13 @@ int write_sec_reg(void __iomem *reg, int val)
 {
        int ret = 0;
        ret = __invoke_nexell_fn_smc(NEXELL_SMC_SEC_REG_WRITE,
-                       (u32)reg, val, 0);
+                       (u32)(uintptr_t)reg, val, 0);
        return ret;
 }
 
 int read_sec_reg(void __iomem *reg)
 {
        int ret = 0;
-       ret = __invoke_nexell_fn_smc(NEXELL_SMC_SEC_REG_READ, (u32)reg, 0, 0);
+       ret = __invoke_nexell_fn_smc(NEXELL_SMC_SEC_REG_READ, (u32)(uintptr_t)reg, 0, 0);
        return ret;
 }