mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH staging-next] goldfish: bus: fix warnings for 32bit builds
@ 2014-05-16  5:24 Octavian Purdila
  2014-05-16  5:24 ` [PATCH staging-next] goldfish: pipe: " Octavian Purdila
  0 siblings, 1 reply; 3+ messages in thread
From: Octavian Purdila @ 2014-05-16  5:24 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, fengguang.wu, Octavian Purdila, Jun Tian, Alan Cox

drivers/platform/goldfish/pdev_bus.c: In function 'goldfish_new_pdev':
drivers/platform/goldfish/pdev_bus.c:136:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  writel((u32)(u64)name, pdev_bus_base + PDEV_BUS_GET_NAME);

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Jun Tian <jun.j.tian@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
---
 drivers/platform/goldfish/pdev_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/goldfish/pdev_bus.c b/drivers/platform/goldfish/pdev_bus.c
index eb25440..8c43589 100644
--- a/drivers/platform/goldfish/pdev_bus.c
+++ b/drivers/platform/goldfish/pdev_bus.c
@@ -133,7 +133,7 @@ static int goldfish_new_pdev(void)
 #ifdef CONFIG_64BIT
 	writel((u32)((u64)name>>32), pdev_bus_base + PDEV_BUS_GET_NAME_HIGH);
 #endif
-	writel((u32)(u64)name, pdev_bus_base + PDEV_BUS_GET_NAME);
+	writel((u32)(unsigned long)name, pdev_bus_base + PDEV_BUS_GET_NAME);
 	name[name_len] = '\0';
 	dev->pdev.id = readl(pdev_bus_base + PDEV_BUS_ID);
 	dev->pdev.resource[0].start = base;
-- 
1.8.3.2


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

* [PATCH staging-next] goldfish: pipe: fix warnings for 32bit builds
  2014-05-16  5:24 [PATCH staging-next] goldfish: bus: fix warnings for 32bit builds Octavian Purdila
@ 2014-05-16  5:24 ` Octavian Purdila
  2014-05-16  9:17   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Octavian Purdila @ 2014-05-16  5:24 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, fengguang.wu, Octavian Purdila, Jun Tian, Alan Cox

drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd_status':
drivers/platform/goldfish/goldfish_pipe.c:164:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
                 ^
drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd':
drivers/platform/goldfish/goldfish_pipe.c:180:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
                 ^
drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_pipe_read_write':
drivers/platform/goldfish/goldfish_pipe.c:337:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
       writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: Jun Tian <jun.j.tian@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
---
 drivers/platform/goldfish/goldfish_pipe.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index c86180b..d9a09d9 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -158,7 +158,7 @@ static u32 goldfish_cmd_status(struct goldfish_pipe *pipe, u32 cmd)
 	struct goldfish_pipe_dev *dev = pipe->dev;
 
 	spin_lock_irqsave(&dev->lock, flags);
-	gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL,
+	gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL,
 				dev->base + PIPE_REG_CHANNEL_HIGH);
 	writel(cmd, dev->base + PIPE_REG_COMMAND);
 	status = readl(dev->base + PIPE_REG_STATUS);
@@ -172,7 +172,7 @@ static void goldfish_cmd(struct goldfish_pipe *pipe, u32 cmd)
 	struct goldfish_pipe_dev *dev = pipe->dev;
 
 	spin_lock_irqsave(&dev->lock, flags);
-	gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL,
+	gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL,
 				dev->base + PIPE_REG_CHANNEL_HIGH);
 	writel(cmd, dev->base + PIPE_REG_COMMAND);
 	spin_unlock_irqrestore(&dev->lock, flags);
@@ -327,8 +327,9 @@ static ssize_t goldfish_pipe_read_write(struct file *filp, char __user *buffer,
 		spin_lock_irqsave(&dev->lock, irq_flags);
 		if (access_with_param(dev, CMD_WRITE_BUFFER + cmd_offset,
 				address, avail, pipe, &status)) {
-			gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL,
-					dev->base + PIPE_REG_CHANNEL_HIGH);
+			gf_write64((u64)(unsigned long)pipe,
+				   dev->base + PIPE_REG_CHANNEL,
+				   dev->base + PIPE_REG_CHANNEL_HIGH);
 			writel(avail, dev->base + PIPE_REG_SIZE);
 			gf_write64(address, dev->base + PIPE_REG_ADDRESS,
 				dev->base + PIPE_REG_ADDRESS_HIGH);
-- 
1.8.3.2


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

* Re: [PATCH staging-next] goldfish: pipe: fix warnings for 32bit builds
  2014-05-16  5:24 ` [PATCH staging-next] goldfish: pipe: " Octavian Purdila
@ 2014-05-16  9:17   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2014-05-16  9:17 UTC (permalink / raw)
  To: Octavian Purdila; +Cc: greg, linux-kernel, fengguang.wu, Jun Tian

On Fri, 2014-05-16 at 08:24 +0300, Octavian Purdila wrote:
> drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd_status':
> drivers/platform/goldfish/goldfish_pipe.c:164:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>      writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
>                  ^
> drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd':
> drivers/platform/goldfish/goldfish_pipe.c:180:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>      writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
>                  ^
> drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_pipe_read_write':
> drivers/platform/goldfish/goldfish_pipe.c:337:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>        writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Cc: Jun Tian <jun.j.tian@intel.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>

Thanks...

Both

Acked-by: Alan Cox <alan@linux.intel.com>


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

end of thread, other threads:[~2014-05-16  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16  5:24 [PATCH staging-next] goldfish: bus: fix warnings for 32bit builds Octavian Purdila
2014-05-16  5:24 ` [PATCH staging-next] goldfish: pipe: " Octavian Purdila
2014-05-16  9:17   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®