]> git.sur5r.net Git - u-boot/commitdiff
x86: Tidy up use of size_t in relocation
authorSimon Glass <sjg@chromium.org>
Mon, 16 Jan 2017 14:03:55 +0000 (07:03 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 6 Feb 2017 03:38:46 +0000 (11:38 +0800)
Addresses should not be cast to size_t. Use uintptr_t instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/relocate.c

index d207fddb7560435f7846ba75b50eaf037a8e3d3e..1da5210d27b6edac653c4f20488b84aa6432f60c 100644 (file)
@@ -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;