From: Simon Glass Date: Sat, 19 Nov 2016 13:25:19 -0700 Subject: [U-Boot] [PATCH v2 30/63] x86: Tidy up use of size_t in relocation In-Reply-To: <1479587152-25065-1-git-send-email-sjg@chromium.org> References: <1479587152-25065-1-git-send-email-sjg@chromium.org> Message-ID: <1479587152-25065-31-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Addresses should not be cast to size_t. Use uintptr_t instead. Signed-off-by: Simon Glass --- Changes in v2: None arch/x86/lib/relocate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index bac2fb6..ad47c7e 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR; int copy_uboot_to_ram(void) { - size_t len = (size_t)&__data_end - (size_t)&__text_start; + size_t len = (uintptr_t)&__data_end - (uintptr_t)&__text_start; if (gd->flags & GD_FLG_SKIP_RELOC) return 0; @@ -38,7 +38,7 @@ int copy_uboot_to_ram(void) int clear_bss(void) { ulong dst_addr = (ulong)&__bss_start + gd->reloc_off; - size_t len = (size_t)&__bss_end - (size_t)&__bss_start; + size_t len = (uintptr_t)&__bss_end - (uintptr_t)&__bss_start; if (gd->flags & GD_FLG_SKIP_RELOC) return 0; -- 2.8.0.rc3.226.g39d4020