[U-Boot] [PATCH] spl: Fix compilation warnings for arm64

Michal Simek michal.simek at xilinx.com
Fri Jul 22 09:23:11 CEST 2016


On 22.7.2016 05:21, Simon Glass wrote:
> Hi Michael,
> 
> On 18 July 2016 at 01:07, Michal Simek <michal.simek at xilinx.com> wrote:
>> Hi Simon,
>>
>> On 17.7.2016 16:12, Simon Glass wrote:
>>> Hi Michal,
>>>
>>> On 15 July 2016 at 00:48, Michal Simek <michal.simek at xilinx.com> wrote:
>>>> Make code 64bit aware.
>>>>
>>>> Warnings:
>>>> +../arch/arm/lib/spl.c: In function ‘jump_to_image_linux’:
>>>> +../arch/arm/lib/spl.c:63:3: warning: cast to pointer from integer of
>>>> different size [-Wint-to-pointer-cast]
>>>> +../common/spl/spl_fat.c: In function ‘spl_load_image_fat’:
>>>> +../common/spl/spl_fat.c:91:33: warning: cast to pointer from integer
>>>> of different size [-Wint-to-pointer-cast]
>>>>
>>>> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
>>>> ---
>>>>
>>>>  arch/arm/lib/spl.c   | 2 +-
>>>>  common/spl/spl_fat.c | 3 ++-
>>>>  2 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>>
>>> You could use map_sysmem() / unmap_sysmem() to convert a ulong address
>>> into a pointer.
>>
>> Isn't this used more for remapping with non zero length?
>> I see in the code that people are using it just for conversion but the
>> question is if this is right usage.
> 
> You are supposed to unmap afterwards. Is that not possible?

The first one is __noreturn function. It means I can't see a way where
to call unmap.

The second one is different. You want to only map that image and
probably at the end you will jump to it. For error case I see that unmap
should be called.
I will use the first version and moving to map_sysmem can be done later.

Thanks,
Michal


More information about the U-Boot mailing list