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

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().

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tolga Ceylan and committed by
Greg Kroah-Hartman
02eb884f bae97e81

+4 -4
+4 -4
drivers/staging/fbtft/fbtft-bus.c
··· 184 184 /* 16 bit pixel over 9-bit SPI bus: dc + high byte, dc + low byte */ 185 185 int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len) 186 186 { 187 - u8 *vmem8; 187 + u8 __iomem *vmem8; 188 188 u16 *txbuf16 = par->txbuf.buf; 189 189 size_t remain; 190 190 size_t to_copy; ··· 212 212 213 213 #ifdef __LITTLE_ENDIAN 214 214 for (i = 0; i < to_copy; i += 2) { 215 - txbuf16[i] = 0x0100 | vmem8[i+1]; 216 - txbuf16[i+1] = 0x0100 | vmem8[i]; 215 + txbuf16[i] = 0x0100 | ioread8(vmem8 + i + 1); 216 + txbuf16[i + 1] = 0x0100 | ioread8(vmem8 + i); 217 217 } 218 218 #else 219 219 for (i = 0; i < to_copy; i++) 220 - txbuf16[i] = 0x0100 | vmem8[i]; 220 + txbuf16[i] = 0x0100 | ioread8(vmem8 + i); 221 221 #endif 222 222 vmem8 = vmem8 + to_copy; 223 223 ret = par->fbtftops.write(par, par->txbuf.buf, to_copy*2);