mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem
@ 2015-05-02  6:40 Tolga Ceylan
  2015-05-03 19:55 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Tolga Ceylan @ 2015-05-02  6:40 UTC (permalink / raw)
  To: Thomas Petazzoni, Noralf Trønnes, Greg Kroah-Hartman, devel,
	linux-kernel
  Cc: 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().

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
---
 drivers/staging/fbtft/fbtft-bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c
index 52af9cb..e0acd3f 100644
--- a/drivers/staging/fbtft/fbtft-bus.c
+++ b/drivers/staging/fbtft/fbtft-bus.c
@@ -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);
-- 
2.3.7


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

* Re: [PATCH 1/1] drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem
  2015-05-02  6:40 [PATCH 1/1] drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem Tolga Ceylan
@ 2015-05-03 19:55 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-05-03 19:55 UTC (permalink / raw)
  To: Tolga Ceylan; +Cc: Thomas Petazzoni, Noralf Trønnes, devel, linux-kernel

On Fri, May 01, 2015 at 11:40:35PM -0700, Tolga Ceylan wrote:
> 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>
> ---
>  drivers/staging/fbtft/fbtft-bus.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Someone send this before you did, sorry :(

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

end of thread, other threads:[~2015-05-03 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-02  6:40 [PATCH 1/1] drivers: staging: fbtft: fbtft-bus.c: Fix different address space warning on I/O mem Tolga Ceylan
2015-05-03 19:55 ` Greg Kroah-Hartman

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

Powered by JetHome