From: Jaewon Kim Date: Thu, 18 May 2017 07:03:35 +0000 (+0900) Subject: arm: nexell: fix type casting warning X-Git-Tag: submit/tizen/20171208.054649~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e30d14fcb0282414493688e3c1de45616c800d03;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik7.git arm: nexell: fix type casting warning 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 --- diff --git a/arch/arm/mach-nexell/nx_sec_reg.c b/arch/arm/mach-nexell/nx_sec_reg.c index a6b522cbdc..c5e6151a17 100644 --- a/arch/arm/mach-nexell/nx_sec_reg.c +++ b/arch/arm/mach-nexell/nx_sec_reg.c @@ -5,6 +5,7 @@ * SPDX-License-Identifier: GPL-2.0+ */ +#include #include #include #include @@ -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; }