aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2015-06-10 14:00:17 -0400
committerJens Axboe <axboe@fb.com>2015-06-10 16:06:53 -0400
commite7bdd17b0869782d89c371507ee45bb1425615a0 (patch)
treeb8dadcfaa5651fe8e5894b4db896b06ad30ecff4
parenta5768aa887fb636f0cc4c83a2f1242506aaf50f6 (diff)
block/ps3vram: Fix sparse warnings
Fix sparse warnings like these: drivers/block/ps3vram.c: warning: incorrect type in assignment (different address spaces) drivers/block/ps3vram.c: expected unsigned int [usertype] *ctrl drivers/block/ps3vram.c: got void [noderef] <asn:2>* Cc: Jim Paris <jim@jtan.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Geoff Levand <geoff@infradead.org> Acked-by: Jim Paris <jim@jtan.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/block/ps3vram.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index ef45cfb98fd2..a7bf83639ba0 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -73,8 +73,8 @@ struct ps3vram_priv {
73 73
74 u64 memory_handle; 74 u64 memory_handle;
75 u64 context_handle; 75 u64 context_handle;
76 u32 *ctrl; 76 u32 __iomem *ctrl;
77 void *reports; 77 void __iomem *reports;
78 u8 *xdr_buf; 78 u8 *xdr_buf;
79 79
80 u32 *fifo_base; 80 u32 *fifo_base;
@@ -104,7 +104,7 @@ static char *size = "256M";
104module_param(size, charp, 0); 104module_param(size, charp, 0);
105MODULE_PARM_DESC(size, "memory size"); 105MODULE_PARM_DESC(size, "memory size");
106 106
107static u32 *ps3vram_get_notifier(void *reports, int notifier) 107static u32 __iomem *ps3vram_get_notifier(void __iomem *reports, int notifier)
108{ 108{
109 return reports + DMA_NOTIFIER_OFFSET_BASE + 109 return reports + DMA_NOTIFIER_OFFSET_BASE +
110 DMA_NOTIFIER_SIZE * notifier; 110 DMA_NOTIFIER_SIZE * notifier;
@@ -113,22 +113,22 @@ static u32 *ps3vram_get_notifier(void *reports, int notifier)
113static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev) 113static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev)
114{ 114{
115 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); 115 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
116 u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); 116 u32 __iomem *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
117 int i; 117 int i;
118 118
119 for (i = 0; i < 4; i++) 119 for (i = 0; i < 4; i++)
120 notify[i] = 0xffffffff; 120 iowrite32be(0xffffffff, notify + i);
121} 121}
122 122
123static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev, 123static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev,
124 unsigned int timeout_ms) 124 unsigned int timeout_ms)
125{ 125{
126 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); 126 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
127 u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER); 127 u32 __iomem *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
128 unsigned long timeout; 128 unsigned long timeout;
129 129
130 for (timeout = 20; timeout; timeout--) { 130 for (timeout = 20; timeout; timeout--) {
131 if (!notify[3]) 131 if (!ioread32be(notify + 3))
132 return 0; 132 return 0;
133 udelay(10); 133 udelay(10);
134 } 134 }
@@ -136,7 +136,7 @@ static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev,
136 timeout = jiffies + msecs_to_jiffies(timeout_ms); 136 timeout = jiffies + msecs_to_jiffies(timeout_ms);
137 137
138 do { 138 do {
139 if (!notify[3]) 139 if (!ioread32be(notify + 3))
140 return 0; 140 return 0;
141 msleep(1); 141 msleep(1);
142 } while (time_before(jiffies, timeout)); 142 } while (time_before(jiffies, timeout));
@@ -148,8 +148,8 @@ static void ps3vram_init_ring(struct ps3_system_bus_device *dev)
148{ 148{
149 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); 149 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
150 150
151 priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET; 151 iowrite32be(FIFO_BASE + FIFO_OFFSET, priv->ctrl + CTRL_PUT);
152 priv->ctrl[CTRL_GET] = FIFO_BASE + FIFO_OFFSET; 152 iowrite32be(FIFO_BASE + FIFO_OFFSET, priv->ctrl + CTRL_GET);
153} 153}
154 154
155static int ps3vram_wait_ring(struct ps3_system_bus_device *dev, 155static int ps3vram_wait_ring(struct ps3_system_bus_device *dev,
@@ -159,14 +159,14 @@ static int ps3vram_wait_ring(struct ps3_system_bus_device *dev,
159 unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); 159 unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
160 160
161 do { 161 do {
162 if (priv->ctrl[CTRL_PUT] == priv->ctrl[CTRL_GET]) 162 if (ioread32be(priv->ctrl + CTRL_PUT) == ioread32be(priv->ctrl + CTRL_GET))
163 return 0; 163 return 0;
164 msleep(1); 164 msleep(1);
165 } while (time_before(jiffies, timeout)); 165 } while (time_before(jiffies, timeout));
166 166
167 dev_warn(&dev->core, "FIFO timeout (%08x/%08x/%08x)\n", 167 dev_warn(&dev->core, "FIFO timeout (%08x/%08x/%08x)\n",
168 priv->ctrl[CTRL_PUT], priv->ctrl[CTRL_GET], 168 ioread32be(priv->ctrl + CTRL_PUT), ioread32be(priv->ctrl + CTRL_GET),
169 priv->ctrl[CTRL_TOP]); 169 ioread32be(priv->ctrl + CTRL_TOP));
170 170
171 return -ETIMEDOUT; 171 return -ETIMEDOUT;
172} 172}
@@ -189,7 +189,7 @@ static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev)
189 189
190 ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET)); 190 ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET));
191 191
192 priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET; 192 iowrite32be(FIFO_BASE + FIFO_OFFSET, priv->ctrl + CTRL_PUT);
193 193
194 /* asking the HV for a blit will kick the FIFO */ 194 /* asking the HV for a blit will kick the FIFO */
195 status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0); 195 status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0);
@@ -207,8 +207,8 @@ static void ps3vram_fire_ring(struct ps3_system_bus_device *dev)
207 207
208 mutex_lock(&ps3_gpu_mutex); 208 mutex_lock(&ps3_gpu_mutex);
209 209
210 priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET + 210 iowrite32be(FIFO_BASE + FIFO_OFFSET + (priv->fifo_ptr - priv->fifo_base)
211 (priv->fifo_ptr - priv->fifo_base) * sizeof(u32); 211 * sizeof(u32), priv->ctrl + CTRL_PUT);
212 212
213 /* asking the HV for a blit will kick the FIFO */ 213 /* asking the HV for a blit will kick the FIFO */
214 status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0); 214 status = lv1_gpu_fb_blit(priv->context_handle, 0, 0, 0, 0);