Re: [PATCH] staging: fbtft: add typecast in call to vfree()
From: Dan Carpenter
Date: Thu Oct 01 2015 - 11:24:04 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/