[U-Boot] drivers/core/read.c:64:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Simon Glass sjg at chromium.org
Mon Sep 25 02:14:01 UTC 2017


+Bin

Hi Heinrich,

On 21 September 2017 at 05:11, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> Hello Simon,
>
> sandbox_defconfig has
>
> arch/sandbox/include/asm/types.h:60: typedef u32 phys_addr_t;
>
> even if building on a 64bit machine.
>
> This results in a warning
>
>   CC      drivers/demo/demo-uclass.o
> drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> drivers/core/read.c:64:44: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
>   return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
>
> Why don't we set phys_addr_t according to the host architecture?

This is because sandbox uses 32-bit address internally, at least that
was my intention. The sandbox architecture does not mirror its host,
but tries to define it own memory model.

This above line should use map_sysmem() to convert the address to a pointer.

Regards,
Simon


More information about the U-Boot mailing list