[U-Boot] [PATCH] zynq: fb_mmc: Correct cast of address to u32

This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org ---
common/fb_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 2113b6c372..012c3f07b2 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -162,7 +162,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, void *download_buffer, unsigned int download_bytes) { - u32 hdr_addr; /* boot image header address */ + ulong hdr_addr; /* boot image header address */ struct andr_img_hdr *hdr; /* boot image header */ lbaint_t hdr_sectors; /* boot image header sectors */ u8 *ramdisk_buffer; @@ -185,7 +185,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, }
/* Put boot image header in fastboot buffer after downloaded zImage */ - hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE); + hdr_addr = (ulong)download_buffer + ALIGN(download_bytes, PAGE_SIZE); hdr = (struct andr_img_hdr *)hdr_addr;
/* Read boot image header */

On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.

On 07/23/2017 05:47 PM, Tom Rini wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
MMC patch via USB ? Anyway, this should use uintptr_t I guess ?

On Mon, Jul 24, 2017 at 02:09:56PM +0200, Marek Vasut wrote:
On 07/23/2017 05:47 PM, Tom Rini wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
MMC patch via USB ? Anyway, this should use uintptr_t I guess ?
"fastboot" is USB gadget code, and comes via Lukasz. Unless you want me to pick it up directly? Thanks!

On 07/24/2017 02:47 PM, Tom Rini wrote:
On Mon, Jul 24, 2017 at 02:09:56PM +0200, Marek Vasut wrote:
On 07/23/2017 05:47 PM, Tom Rini wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
MMC patch via USB ? Anyway, this should use uintptr_t I guess ?
"fastboot" is USB gadget code, and comes via Lukasz. Unless you want me to pick it up directly? Thanks!
The tags didn't indicate any such thing and I didn't see the entire patch since it was clipped, so ... anyway, if it's fastboot, it indeed goes via Lukasz.

On 07/24/2017 02:53 PM, Marek Vasut wrote:
On 07/24/2017 02:47 PM, Tom Rini wrote:
On Mon, Jul 24, 2017 at 02:09:56PM +0200, Marek Vasut wrote:
On 07/23/2017 05:47 PM, Tom Rini wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
MMC patch via USB ? Anyway, this should use uintptr_t I guess ?
"fastboot" is USB gadget code, and comes via Lukasz. Unless you want me to pick it up directly? Thanks!
The tags didn't indicate any such thing and I didn't see the entire patch since it was clipped, so ... anyway, if it's fastboot, it indeed goes via Lukasz.
The fb_mmc.c is a bit misleading.
I will take this patch when we fix issues with u-boot-usb tree.

On 07/24/2017 03:28 PM, Łukasz Majewski wrote:
On 07/24/2017 02:53 PM, Marek Vasut wrote:
On 07/24/2017 02:47 PM, Tom Rini wrote:
On Mon, Jul 24, 2017 at 02:09:56PM +0200, Marek Vasut wrote:
On 07/23/2017 05:47 PM, Tom Rini wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
MMC patch via USB ? Anyway, this should use uintptr_t I guess ?
"fastboot" is USB gadget code, and comes via Lukasz. Unless you want me to pick it up directly? Thanks!
The tags didn't indicate any such thing and I didn't see the entire patch since it was clipped, so ... anyway, if it's fastboot, it indeed goes via Lukasz.
The fb_mmc.c is a bit misleading.
I will take this patch when we fix issues with u-boot-usb tree.
Super, thanks. Seems that'll not take long anymore ...

On 23 July 2017 at 09:47, Tom Rini trini@konsulko.com wrote:
On Sun, Jul 23, 2017 at 09:05:31AM -0600, Simon Glass wrote:
This does not work on 64-bit machines. Update it to use ulong.
This fixes the following warnings in some zynq boards;
common/fb_mmc.c: In function 'fb_mmc_update_zimage': common/fb_mmc.c:188:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] common/fb_mmc.c:189:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Signed-off-by: Simon Glass sjg@chromium.org
I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.
OK thanks.
- Simon
participants (4)
-
Marek Vasut
-
Simon Glass
-
Tom Rini
-
Łukasz Majewski