Skip to contentSkip to conversation

cfi_flash: Use uintptr_t for casts from u32 to void *

PATCH New Stefan Roese 1 participant 2 messages Apr 3, 2013 – Apr 4, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfi_flash: Use uintptr_t for casts from u32 to void *

This fixes this build warning:

Configuring for qemu_mips64 - Board: qemu-mips64, Options: SYS_BIG_ENDIAN
text data bss dec hex filename
215344 13082 218720 447146 6d2aa qemu_mips64/u-boot
cfi_flash.c: In function 'flash_map':
cfi_flash.c:217:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

---
 drivers/mtd/cfi_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/cfi_flash.c +1 -1
index 328c76d..cf10b0d 100644
@@ -214,7 +214,7 @@ flash_map (flash_info_t * info, flash_sect_t sect, uint offset)
 	unsigned int addr = (info->start[sect] + byte_offset);
 	unsigned int mask = 0xffffffff << (info->portwidth - 1);
 
-	return (void *)(addr & mask);
+	return (void *)(uintptr_t)(addr & mask);
 }
 
 static inline void flash_unmap(flash_info_t *info, flash_sect_t sect,
Signature · 1 line
1.8.2
#1 lore raw

PATCH 1/1 cfi_flash: Use uintptr_t for casts from u32 to void *

Quoted 10 lines · Stefan Roese

This fixes this build warning:

Configuring for qemu_mips64 - Board: qemu-mips64, Options: SYS_BIG_ENDIAN
text data bss dec hex filename
215344 13082 218720 447146 6d2aa qemu_mips64/u-boot
cfi_flash.c: In function 'flash_map':
cfi_flash.c:217:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Applied to u-boot-cfi-flash/master.

Thanks,
Stefan