* [PATCH] staging: fbtft: add typecast in call to vfree()
@ 2015-10-01 13:00 Lars Svensson
2015-10-01 15:23 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Lars Svensson @ 2015-10-01 13:00 UTC (permalink / raw)
To: thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel, Lars Svensson
Member screen_base in struct fb_info is declared __iomem causing
a sparse warning as below when passed to vfree(). This adds typecast
(__force void *) to silence the warning.
fbtft-core.c:922:39: warning: incorrect type in argument 1 \
(different address spaces)
fbtft-core.c:922:39: expected void const *addr
fbtft-core.c:922:39: got char [noderef] <asn:2>*screen_base
Signed-off-by: Lars Svensson <lars1.svensson@sonymobile.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 7f5fa3d..3e91fb5 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -919,7 +919,7 @@ EXPORT_SYMBOL(fbtft_framebuffer_alloc);
void fbtft_framebuffer_release(struct fb_info *info)
{
fb_deferred_io_cleanup(info);
- vfree(info->screen_base);
+ vfree((__force void *)info->screen_base);
framebuffer_release(info);
}
EXPORT_SYMBOL(fbtft_framebuffer_release);
--
2.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: fbtft: add typecast in call to vfree()
2015-10-01 13:00 [PATCH] staging: fbtft: add typecast in call to vfree() Lars Svensson
@ 2015-10-01 15:23 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-10-01 15:23 UTC (permalink / raw)
To: Lars Svensson; +Cc: thomas.petazzoni, noralf, devel, gregkh, linux-kernel
On Thu, Oct 01, 2015 at 03:00:12PM +0200, Lars Svensson wrote:
> Member screen_base in struct fb_info is declared __iomem causing
> a sparse warning as below when passed to vfree(). This adds typecast
> (__force void *) to silence the warning.
>
> fbtft-core.c:922:39: warning: incorrect type in argument 1 \
> (different address spaces)
> fbtft-core.c:922:39: expected void const *addr
> fbtft-core.c:922:39: got char [noderef] <asn:2>*screen_base
>
I thought we were going to do something like this:
diff --git a/include/linux/fb.h b/include/linux/fb.h
index be40dba..3324c92 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -483,7 +483,10 @@ struct fb_info {
#ifdef CONFIG_FB_TILEBLITTING
struct fb_tile_ops *tileops; /* Tile Blitting */
#endif
- char __iomem *screen_base; /* Virtual address */
+ union {
+ char __iomem *screen_base; /* Virtual address */
+ char *fake_screen_base;
+ };
unsigned long screen_size; /* Amount of ioremapped VRAM or 0 */
void *pseudo_palette; /* Fake palette of 16 colors */
#define FBINFO_STATE_RUNNING 0
The only question is what to call the fake_screen_base.
regards,
dan carpenter
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-01 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 13:00 [PATCH] staging: fbtft: add typecast in call to vfree() Lars Svensson
2015-10-01 15:23 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox