diff mbox

[U-Boot] fastboot: mmc: fix pointer size warning in 64bit system

Message ID 1502093669-2985-1-git-send-email-kever.yang@rock-chips.com
State Superseded
Delegated to: Lukasz Majewski
Headers show

Commit Message

Kever Yang Aug. 7, 2017, 8:14 a.m. UTC
To fix warning in ARM64:
common/fb_mmc.c: In function ‘fb_mmc_update_zimage’:
common/fb_mmc.c:216:13: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
  hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
             ^
common/fb_mmc.c:217:8: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
  hdr = (struct andr_img_hdr *)hdr_addr;

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 common/fb_mmc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Simon Glass Aug. 13, 2017, 3:35 p.m. UTC | #1
On 7 August 2017 at 02:14, Kever Yang <kever.yang@rock-chips.com> wrote:
> To fix warning in ARM64:
> common/fb_mmc.c: In function ‘fb_mmc_update_zimage’:
> common/fb_mmc.c:216:13: warning: cast from pointer to integer of
> different size [-Wpointer-to-int-cast]
>   hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
>              ^
> common/fb_mmc.c:217:8: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
>   hdr = (struct andr_img_hdr *)hdr_addr;
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  common/fb_mmc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Jaehoon Chung Aug. 18, 2017, 7:28 a.m. UTC | #2
On 08/14/2017 12:35 AM, Simon Glass wrote:
> On 7 August 2017 at 02:14, Kever Yang <kever.yang@rock-chips.com> wrote:
>> To fix warning in ARM64:
>> common/fb_mmc.c: In function ‘fb_mmc_update_zimage’:
>> common/fb_mmc.c:216:13: warning: cast from pointer to integer of
>> different size [-Wpointer-to-int-cast]
>>   hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
>>              ^
>> common/fb_mmc.c:217:8: warning: cast to pointer from integer of
>> different size [-Wint-to-pointer-cast]
>>   hdr = (struct andr_img_hdr *)hdr_addr;
>>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>>
>>  common/fb_mmc.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

> 
> 
>
Sam Protsenko Aug. 18, 2017, 9:50 a.m. UTC | #3
On 18 August 2017 at 10:28, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> On 08/14/2017 12:35 AM, Simon Glass wrote:
>> On 7 August 2017 at 02:14, Kever Yang <kever.yang@rock-chips.com> wrote:
>>> To fix warning in ARM64:
>>> common/fb_mmc.c: In function ‘fb_mmc_update_zimage’:
>>> common/fb_mmc.c:216:13: warning: cast from pointer to integer of
>>> different size [-Wpointer-to-int-cast]
>>>   hdr_addr = (u32)download_buffer + ALIGN(download_bytes, PAGE_SIZE);
>>>              ^
>>> common/fb_mmc.c:217:8: warning: cast to pointer from integer of
>>> different size [-Wint-to-pointer-cast]
>>>   hdr = (struct andr_img_hdr *)hdr_addr;
>>>
>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>> ---
>>>
>>>  common/fb_mmc.c | 4 +---
>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
>

Guys,

I believe it was already fixed, only not merged yet. Please see [1,2].

[1] https://lists.denx.de/pipermail/u-boot/2017-June/295059.html
[2] https://patchwork.ozlabs.org/patch/792569/

>>
>>
>>
>
diff mbox

Patch

diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index a4b73dc..4511b8c 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -190,7 +190,6 @@  static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
 				unsigned int download_bytes,
 				char *response)
 {
-	u32 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;
@@ -213,8 +212,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 = (struct andr_img_hdr *)hdr_addr;
+	hdr = download_buffer + ALIGN(download_bytes, PAGE_SIZE);
 
 	/* Read boot image header */
 	hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr, response);