Fix pointer cast for 32 bits arch
PATCH v2 1/1 Fix pointer cast for 32 bits arch
Sparse compalins about casting void * to u64 on i386. Change the cast to resource_size_t.
Also update the gf_write64 function definition changing the first argument type from unsigned long data to resource_size_t.
Signed-off-by Peter Senna Tschudin <[email protected]>
---
Changes from V1:
- Updated commit message.
Tested by compilation only. Tested for x86 and x86_64.
drivers/staging/goldfish/goldfish_nand.c | 3 ++- include/linux/goldfish.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/staging/goldfish/goldfish_nand.c +2 -1
@@ -87,7 +87,8 @@ static u32 goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd,writel ((u32)(addr >>32 ), base +NAND_ADDR_HIGH );writel ((u32 )addr, base +NAND_ADDR_LOW );writel (len, base +NAND_TRANSFER_SIZE ); -gf_write64 ((u64 )ptr, base +NAND_DATA , base +NAND_DATA_HIGH ); +gf_write64 ((resource_size_t )ptr, base +NAND_DATA , + base +NAND_DATA_HIGH );writel (cmd, base +NAND_COMMAND ); rv =readl (base +NAND_RESULT ); }
include/linux/goldfish.h +1 -1
@@ -3,7 +3,7 @@/* Helpers for Goldfish virtual platform */ -static inline void gf_write64 (unsigned long data, +static inline void gf_write64 (resource_size_t data,void __iomem *portl,void __iomem *porth) {writel ((u32 )data, portl);
Signature · 1 line
2.1.0
Quoted 1 line · Peter Senna Tschudin
Sparse compalins about casting void * to u64 on i386.
s/compalins/complains/
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."