Skip to contentSkip to conversation

drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem

PATCH In review Tolga Ceylan 2 participants 2 messages May 2, 2015 – May 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem

To fix sparse warning of incorrect type in assignment (different address space), added annotation __iomem to vmem8 and modified direct reads with ioread8().

---
 drivers/staging/fbtft/fbtft-bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/fbtft/fbtft-bus.c +4 -4
index 52af9cb..e0acd3f 100644
@@ -184,7 +184,7 @@ EXPORT_SYMBOL(fbtft_write_vmem16_bus8);
 /* 16 bit pixel over 9-bit SPI bus: dc + high byte, dc + low byte */
 int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)
 {
-	u8 *vmem8;
+	u8 __iomem *vmem8;
 	u16 *txbuf16 = par->txbuf.buf;
 	size_t remain;
 	size_t to_copy;
@@ -212,12 +212,12 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len)
 
 #ifdef __LITTLE_ENDIAN
 		for (i = 0; i < to_copy; i += 2) {
-			txbuf16[i]   = 0x0100 | vmem8[i+1];
-			txbuf16[i+1] = 0x0100 | vmem8[i];
+			txbuf16[i]     = 0x0100 | ioread8(vmem8 + i + 1);
+			txbuf16[i + 1] = 0x0100 | ioread8(vmem8 + i);
 		}
 #else
 		for (i = 0; i < to_copy; i++)
-			txbuf16[i]   = 0x0100 | vmem8[i];
+			txbuf16[i]   = 0x0100 | ioread8(vmem8 + i);
 #endif
 		vmem8 = vmem8 + to_copy;
 		ret = par->fbtftops.write(par, par->txbuf.buf, to_copy*2);
Signature · 1 line
2.3.7
#1 lore raw
Quoted 8 lines · Tolga Ceylan

To fix sparse warning of incorrect type in assignment (different address space), added annotation __iomem to vmem8 and modified direct reads with ioread8().

---
 drivers/staging/fbtft/fbtft-bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Someone send this before you did, sorry :(