[U-Boot] [PATCH v4 11/15] dm: Fix printf() strings in the 'dm' command

Simon Glass sjg at chromium.org
Thu Jun 12 05:34:15 CEST 2014


Hi Andre,

On 8 June 2014 18:46, Andre Renaud <andre at bluewatersys.com> wrote:
> On 7 June 2014 07:13, Simon Glass <sjg at chromium.org> wrote:
>> The values here are int, but the map_to_sysmem() call can return a long.
>> Add a cast to deal with this.
> ...
>> -       printf("%s- %s @ %08x", buf, in->name, map_to_sysmem(in));
>> +       printf("%s- %s @ %08x", buf, in->name, (uint)map_to_sysmem(in));
>
> If the argument is a long, shouldn't it be printed as long, rather
> than possibly truncated to an int?
>  printf("%s- %s @ %08lx", buf, in->name, map_to_sysmem(in));

I found that this happened on ARM, where sizeof(int) == sizeof(long)
and was conscious that all addresses in U-Boot are 32-bits at present
- hmmm is that still true?.

But yes that is more correct. I will change it.

Regards,
Simon


More information about the U-Boot mailing list