Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

goldfish: pipe: fix warnings for 32bit builds

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>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Octavian Purdila and committed by
Greg Kroah-Hartman
f4e131dc f2dbdf62

+5 -4
+5 -4
drivers/platform/goldfish/goldfish_pipe.c
··· 158 158 struct goldfish_pipe_dev *dev = pipe->dev; 159 159 160 160 spin_lock_irqsave(&dev->lock, flags); 161 - gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL, 161 + gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL, 162 162 dev->base + PIPE_REG_CHANNEL_HIGH); 163 163 writel(cmd, dev->base + PIPE_REG_COMMAND); 164 164 status = readl(dev->base + PIPE_REG_STATUS); ··· 172 172 struct goldfish_pipe_dev *dev = pipe->dev; 173 173 174 174 spin_lock_irqsave(&dev->lock, flags); 175 - gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL, 175 + gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL, 176 176 dev->base + PIPE_REG_CHANNEL_HIGH); 177 177 writel(cmd, dev->base + PIPE_REG_COMMAND); 178 178 spin_unlock_irqrestore(&dev->lock, flags); ··· 327 327 spin_lock_irqsave(&dev->lock, irq_flags); 328 328 if (access_with_param(dev, CMD_WRITE_BUFFER + cmd_offset, 329 329 address, avail, pipe, &status)) { 330 - gf_write64((u64)pipe, dev->base + PIPE_REG_CHANNEL, 331 - dev->base + PIPE_REG_CHANNEL_HIGH); 330 + gf_write64((u64)(unsigned long)pipe, 331 + dev->base + PIPE_REG_CHANNEL, 332 + dev->base + PIPE_REG_CHANNEL_HIGH); 332 333 writel(avail, dev->base + PIPE_REG_SIZE); 333 334 gf_write64(address, dev->base + PIPE_REG_ADDRESS, 334 335 dev->base + PIPE_REG_ADDRESS_HIGH);