Skip to contentSkip to conversation

zynq: fb_mmc: Correct cast of address to u32

PATCH New Simon Glass 4 participants 8 messages Jul 23, 2017 – Jul 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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]

---

 common/fb_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/fb_mmc.c +2 -2
index 2113b6c372..012c3f07b2 100644
@@ -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 */
Signature · 1 line
2.14.0.rc0.284.gd933b75aa4-goog
#1 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 11 lines · Simon Glass

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]

I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170723/82de5a3a/attachment.sig>
#2 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 12 lines · Tom Rini
Quoted 10 lines · Simon Glass

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]

Quoted 5 lines
Quoted 1 line

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 ?

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 13 lines · Marek Vasut
Quoted 12 lines · Tom Rini
Quoted 10 lines · Simon Glass

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]

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170724/7d28c8ec/attachment.sig>
#4 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 16 lines · Tom Rini
Quoted 15 lines · Marek Vasut
Quoted 14 lines · Tom Rini
Quoted 11 lines · Simon Glass

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]

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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.

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 20 lines · Marek Vasut
Quoted 19 lines · Tom Rini
Quoted 18 lines · Marek Vasut
Quoted 16 lines · Tom Rini
Quoted 11 lines · Simon Glass

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]

I fixed this in a slightly different way a while ago and am waiting for it to come in via the USB tree currently.

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

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.

Signature · 9 lines
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
#6 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

Quoted 29 lines · Å�ukasz Majewski
Quoted 28 lines · Marek Vasut
Quoted 27 lines · Tom Rini
Quoted 15 lines · Marek Vasut
Quoted 14 lines · Tom Rini
Quoted 12 lines · Simon Glass

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]

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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!

Quoted 9 lines
Quoted 4 lines

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 ...

Signature · 2 lines
Best regards,
Marek Vasut
#7 lore raw

PATCH 1/1 zynq: fb_mmc: Correct cast of address to u32

In reply to Tom Rini
Quoted 12 lines · Tom Rini
Quoted 10 lines · Simon Glass

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]

Quoted 4 lines
Quoted 1 line

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