linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: force cast to non-__iomem pointer
@ 2015-04-16 17:29 Garret Kelly
  2015-04-30 14:51 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Garret Kelly @ 2015-04-16 17:29 UTC (permalink / raw)
  To: Thomas Petazzoni, Noralf Trønnes, Greg Kroah-Hartman,
	open list:STAGING SUBSYSTEM, open list
  Cc: Garret Kelly

fbtft uses fb_info's screen_base field to store a non-__iomem
allocation.  Cast away the __iomem qualifier when freeing the pointer to
suppress the sparse warning.

Fixes the following sparse warnings:
drivers/staging/fbtft/fbtft-core.c:918:19: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/fbtft/fbtft-core.c:918:19:    expected void const *addr
drivers/staging/fbtft/fbtft-core.c:918:19:    got char [noderef] <asn:2>*screen_base

Signed-off-by: Garret Kelly <gdk@google.com>
---
 drivers/staging/fbtft/fbtft-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 37dcf7e..1196dda 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -925,7 +925,7 @@ EXPORT_SYMBOL(fbtft_framebuffer_alloc);
 void fbtft_framebuffer_release(struct fb_info *info)
 {
 	fb_deferred_io_cleanup(info);
-	vfree(info->screen_base);
+	vfree((void __force *)info->screen_base);
 	framebuffer_release(info);
 }
 EXPORT_SYMBOL(fbtft_framebuffer_release);
-- 
2.0.2


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

* Re: [PATCH] staging: fbtft: force cast to non-__iomem pointer
  2015-04-16 17:29 [PATCH] staging: fbtft: force cast to non-__iomem pointer Garret Kelly
@ 2015-04-30 14:51 ` Greg Kroah-Hartman
  2015-05-06 21:34   ` Garret Kelly
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-04-30 14:51 UTC (permalink / raw)
  To: Garret Kelly
  Cc: Thomas Petazzoni, Noralf Trønnes,
	open list:STAGING SUBSYSTEM, open list

On Thu, Apr 16, 2015 at 01:29:19PM -0400, Garret Kelly wrote:
> fbtft uses fb_info's screen_base field to store a non-__iomem
> allocation.  Cast away the __iomem qualifier when freeing the pointer to
> suppress the sparse warning.

Can't we fix this properly, to use the correct type of pointer instead
for non-__iomem allocations?

thanks,

greg k-h

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

* Re: [PATCH] staging: fbtft: force cast to non-__iomem pointer
  2015-04-30 14:51 ` Greg Kroah-Hartman
@ 2015-05-06 21:34   ` Garret Kelly
  2015-05-07  8:39     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Garret Kelly @ 2015-05-06 21:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Thomas Petazzoni, Noralf Trønnes,
	open list:STAGING SUBSYSTEM, open list

> Can't we fix this properly, to use the correct type of pointer instead
> for non-__iomem allocations?

You mean making an alternate screen_base pointer inside fb_info that
isn't __iomem?  There are already a bunch of framebuffer drivers that
(ab)use screen_base to store non-__iomem pointers, so this didn't
strike me as too far out of line.

Garret

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

* Re: [PATCH] staging: fbtft: force cast to non-__iomem pointer
  2015-05-06 21:34   ` Garret Kelly
@ 2015-05-07  8:39     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-05-07  8:39 UTC (permalink / raw)
  To: Garret Kelly
  Cc: Greg Kroah-Hartman, open list:STAGING SUBSYSTEM,
	Noralf Trønnes, open list

On Wed, May 06, 2015 at 02:34:49PM -0700, Garret Kelly wrote:
> > Can't we fix this properly, to use the correct type of pointer instead
> > for non-__iomem allocations?
> 
> You mean making an alternate screen_base pointer inside fb_info that
> isn't __iomem?  There are already a bunch of framebuffer drivers that
> (ab)use screen_base to store non-__iomem pointers, so this didn't
> strike me as too far out of line.

You could add a new pointer or you could just make ->screen_base a
union.  I'm not sure which is the best.

regards,
dan carpenter


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

end of thread, other threads:[~2015-05-07  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16 17:29 [PATCH] staging: fbtft: force cast to non-__iomem pointer Garret Kelly
2015-04-30 14:51 ` Greg Kroah-Hartman
2015-05-06 21:34   ` Garret Kelly
2015-05-07  8:39     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).