public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Loic Pefferkorn <loic@loicp.eu>, Alan <alan@linux.intel.com>,
	Jun Tian <jun.j.tian@intel.com>,
	Octavian Purdila <octavian.purdila@intel.com>,
	Garret Kelly <garret.kelly@gmail.com>,
	<kristina.martsenko@gmail.com>, Nick Kralevich <nnk@google.com>,
	Andreas <schwab@linux-m68k.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Subject: [PATCH v3] Fix pointer cast for 32 bits arch
Date: Sun, 12 Apr 2015 13:38:21 +0200	[thread overview]
Message-ID: <1428838701-2263-1-git-send-email-peter.senna@gmail.com> (raw)

Sparse complains about casting void * to u64 on i386.
Change the cast to resource_size_t.

Also update the type of the first argument of gf_write64()
from unsigned long to resource_size_t.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
Changes from V2:
 - Fixed spelling of complains
 - Updated commit message

Changes from V1:
 - Updated commit message

Tested by compilation only. Compiled 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


             reply	other threads:[~2015-04-12 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 11:38 Peter Senna Tschudin [this message]
2015-04-13  9:20 ` [PATCH v3] Fix pointer cast for 32 bits arch Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428838701-2263-1-git-send-email-peter.senna@gmail.com \
    --to=peter.senna@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=garret.kelly@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.j.tian@intel.com \
    --cc=kristina.martsenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic@loicp.eu \
    --cc=nnk@google.com \
    --cc=octavian.purdila@intel.com \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox