Skip to contentSkip to conversation

common/fb_mmc.c: Fix warnings about casts

PATCH New Tom Rini 2 participants 2 messages Jun 10, 2017 – Jun 12, 2017

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 common/fb_mmc.c: Fix warnings about casts

When building the flash zImage code on aarch64 we see warnings about pointer size casts. Use uintptr_t instead to correct these.

Cc Sam Protsenko <[email protected]>
---
 common/fb_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/fb_mmc.c +2 -2
index 2113b6c37239..f085c1b8151c 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 */
+	uintptr_t 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 = (uintptr_t)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
 	hdr = (struct andr_img_hdr *)hdr_addr;
 
 	/* Read boot image header */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 common/fb_mmc.c: Fix warnings about casts

Quoted 32 lines · Tom Rini

When building the flash zImage code on aarch64 we see warnings about pointer size casts. Use uintptr_t instead to correct these.

Cc Sam Protsenko <[email protected]>
---
 common/fb_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/fb_mmc.c +2 -3
index 2113b6c37239..f085c1b8151c 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 */
+       uintptr_t 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 = (uintptr_t)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
        hdr = (struct andr_img_hdr *)hdr_addr;
 
        /* Read boot image header */
--
Quoted 2 lines

1.9.1

Thanks, Tom, I forgot to check the build on ARMv8 boards.