spl: Fix compile warning for arm64
PATCH 1/2 spl: Fix compile warning for arm64
Make the cast explicit for "warning: cast to pointer from integer of different size".
common/spl/spl_mmc.c +1 -1
@@ -44,7 +44,7 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)/* Read the header too to avoid extra memcpy */ count = mmc->block_dev.block_read (0 , sector, image_size_sectors, - (void *)spl_image.load_addr); + (void *)(ulong )spl_image.load_addr);debug ("read %x sectors to %x\n" , image_size_sectors, spl_image.load_addr);
Signature · 1 line
2.1.0.27.g96db324
PATCH 1/2 spl: Fix compile warning for arm64
Hi,
Please help to review the two patches. Thanks!:)
Regards,
Qianyu
-----Original Message-----
From: Gong Qianyu [mailto:Qianyu.Gong at freescale.com]
Sent: Thursday, July 30, 2015 2:07 PM
To: u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Gong Qianyu-B52263
Subject: [PATCH 1/2] spl: Fix compile warning for arm64
Make the cast explicit for "warning: cast to pointer from integer of different size".
common/spl/spl_mmc.c +1 -1
@@ -44,7 +44,7 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)/* Read the header too to avoid extra memcpy */ count = mmc->block_dev.block_read (0 , sector, image_size_sectors, - (void *)spl_image.load_addr); + (void *)(ulong )spl_image.load_addr);debug ("read %x sectors to %x\n" , image_size_sectors, spl_image.load_addr);
--
2.1.0.27.g96db324
-----Original Message-----
From: Gong Qianyu [mailto:Qianyu.Gong at freescale.com]
Sent: Thursday, July 30, 2015 2:00 PM
To: u-boot at lists.denx.de
Cc: Hu Mingkai-B21284; Gong Qianyu-B52263
Subject: [PATCH 2/2] common/cmd_source.c: Fix the source command failure under 64-bit platform
Modify the data pointer type from ulong* to u32*.
For arm64 type "ulong" could be 64-bit. Then in line 89 of common/cmd_source.c:
"while (*data++);" data will point to the next 64 bits each time. As the uImage file generated by mkimage tool keeps the same data format in either 32-bit or 64-bit platform, the difference would cause failure in 64-bit platform.
common/cmd_source.c +3 -3
@@ -33,7 +33,7 @@ source (ulong addr, const char *fit_uname) #if defined(CONFIG_IMAGE_FORMAT_LEGACY)const image_header_t *hdr;#endif -ulong *data; +u32 *data;int verify;void *buf;#if defined(CONFIG_FIT )
@@ -74,7 +74,7 @@ source (ulong addr, const char *fit_uname) }/* get length of script */ - data = (ulong *)image_get_data (hdr); + data = (u32 *)image_get_data (hdr);if ((len =uimage_to_cpu (*data)) ==0 ) {puts ("Empty Script\n" );
@@ -128,7 +128,7 @@ source (ulong addr, const char *fit_uname) return 1; } - data = (ulong *)fit_data; + data = (u32 *)fit_data; len = (ulong )fit_len;break ;#endif
--
2.1.0.27.g96db324
PATCH 1/2 spl: Fix compile warning for arm64
In reply to Gong Qianyucommon/spl/spl_mmc.c
Quoted 6 lines · Gong Qianyu
Make the cast explicit for "warning: cast to pointer from integer of different size".
Signed-off-by Gong Qianyu <[email protected]>common/spl/spl_mmc.c +0
-0
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/5508f9c1/attachment.sig>