From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 17 Jul 2016 08:12:30 -0600 Subject: [U-Boot] [PATCH] spl: Fix compilation warnings for arm64 In-Reply-To: <77d6afa8c48d75a6eaa114fb36fd429bb965d2aa.1468565330.git.michal.simek@xilinx.com> References: <77d6afa8c48d75a6eaa114fb36fd429bb965d2aa.1468565330.git.michal.simek@xilinx.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Michal, On 15 July 2016 at 00:48, Michal Simek 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 > --- > > arch/arm/lib/spl.c | 2 +- > common/spl/spl_fat.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Simon Glass You could use map_sysmem() / unmap_sysmem() to convert a ulong address into a pointer. > > diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c > index e42886840ed6..c1b85340fad6 100644 > --- a/arch/arm/lib/spl.c > +++ b/arch/arm/lib/spl.c > @@ -60,7 +60,7 @@ void __noreturn jump_to_image_linux(void *arg) > typedef void (*image_entry_arg_t)(int, int, void *) > __attribute__ ((noreturn)); > image_entry_arg_t image_entry = > - (image_entry_arg_t) spl_image.entry_point; > + (image_entry_arg_t)(uintptr_t) spl_image.entry_point; > cleanup_before_linux(); > image_entry(0, machid, arg); > } > diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c > index db676186d354..73d33f54fc13 100644 > --- a/common/spl/spl_fat.c > +++ b/common/spl/spl_fat.c > @@ -88,7 +88,8 @@ int spl_load_image_fat(struct blk_desc *block_dev, > if (err) > goto end; > > - err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); > + err = file_fat_read(filename, > + (u8 *)(uintptr_t)spl_image.load_addr, 0); > } > > end: > -- > 1.9.1 >