linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Fix pointer cast for 32 bits arch
@ 2015-04-12  9:31 Peter Senna Tschudin
  2015-04-12 10:56 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Senna Tschudin @ 2015-04-12  9:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Loic Pefferkorn, Alan, Jun Tian,
	Octavian Purdila, Garret Kelly, kristina.martsenko,
	Nick Kralevich, devel, linux-kernel
  Cc: Peter Senna Tschudin

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 <peter.senna@gmail.com>
---
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(-)

diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c
index d68f216..738fdc4 100644
--- a/drivers/staging/goldfish/goldfish_nand.c
+++ b/drivers/staging/goldfish/goldfish_nand.c
@@ -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);
 	}
diff --git a/include/linux/goldfish.h b/include/linux/goldfish.h
index 569236e..494e943 100644
--- a/include/linux/goldfish.h
+++ b/include/linux/goldfish.h
@@ -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);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Fix pointer cast for 32 bits arch
  2015-04-12  9:31 [PATCH v2] Fix pointer cast for 32 bits arch Peter Senna Tschudin
@ 2015-04-12 10:56 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2015-04-12 10:56 UTC (permalink / raw)
  To: Peter Senna Tschudin
  Cc: Greg Kroah-Hartman, Loic Pefferkorn, Alan, Jun Tian,
	Octavian Purdila, Garret Kelly, kristina.martsenko,
	Nick Kralevich, devel, linux-kernel

Peter Senna Tschudin <peter.senna@gmail.com> writes:

> Sparse compalins about casting void * to u64 on i386.

s/compalins/complains/

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-12 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12  9:31 [PATCH v2] Fix pointer cast for 32 bits arch Peter Senna Tschudin
2015-04-12 10:56 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).