lkml.org 
[lkml]   [2013]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 7/8] video: xilinxfb: Fix sparse warnings
Date
Use proper casting for fb_virt variable.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
Changes in v3:
- New patch in this patchset

Changes in v2: None

drivers/video/xilinxfb.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index f3d4a69..e27a4f6 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -131,7 +131,7 @@ struct xilinxfb_drvdata {
dcr_host_t dcr_host;
unsigned int dcr_len;
#endif
- void *fb_virt; /* virt. address of the frame buffer */
+ void __iomem *fb_virt; /* virt. address of the frame buffer */
dma_addr_t fb_phys; /* phys. address of the frame buffer */
int fb_alloced; /* Flag, was the fb memory alloced? */

@@ -273,8 +273,10 @@ static int xilinxfb_assign(struct platform_device *pdev,
drvdata->fb_virt = ioremap(pdata->fb_phys, fbsize);
} else {
drvdata->fb_alloced = 1;
- drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
- &drvdata->fb_phys, GFP_KERNEL);
+ drvdata->fb_virt = (__force void __iomem *)
+ dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
+ &drvdata->fb_phys,
+ GFP_KERNEL);
}

if (!drvdata->fb_virt) {
@@ -287,7 +289,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
}

/* Clear (turn to black) the framebuffer */
- memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);
+ memset_io(drvdata->fb_virt, 0, fbsize);

/* Tell the hardware where the frame buffer is */
xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
@@ -307,7 +309,7 @@ static int xilinxfb_assign(struct platform_device *pdev,

/* Fill struct fb_info */
drvdata->info.device = dev;
- drvdata->info.screen_base = (void __iomem *)drvdata->fb_virt;
+ drvdata->info.screen_base = drvdata->fb_virt;
drvdata->info.fbops = &xilinxfb_ops;
drvdata->info.fix = xilinx_fb_fix;
drvdata->info.fix.smem_start = drvdata->fb_phys;
@@ -341,8 +343,8 @@ static int xilinxfb_assign(struct platform_device *pdev,

if (drvdata->flags & BUS_ACCESS_FLAG) {
/* Put a banner in the log (for DEBUG) */
- dev_dbg(dev, "regs: phys=%x, virt=%p\n", drvdata->regs_phys,
- drvdata->regs);
+ dev_dbg(dev, "regs: phys=%x, virt=%p\n",
+ (u32)drvdata->regs_phys, drvdata->regs);
}
/* Put a banner in the log (for DEBUG) */
dev_dbg(dev, "fb: phys=%llx, virt=%p, size=%x\n",
@@ -355,8 +357,9 @@ err_regfb:

err_cmap:
if (drvdata->fb_alloced)
- dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
- drvdata->fb_phys);
+ dma_free_coherent(dev, PAGE_ALIGN(fbsize),
+ (__force void *)drvdata->fb_virt,
+ drvdata->fb_phys);
else
iounmap(drvdata->fb_virt);

@@ -388,7 +391,8 @@ static int xilinxfb_release(struct device *dev)

if (drvdata->fb_alloced)
dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
- drvdata->fb_virt, drvdata->fb_phys);
+ (__force void *)drvdata->fb_virt,
+ drvdata->fb_phys);
else
iounmap(drvdata->fb_virt);

--
1.8.2.3
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-05-31 22:21    [W:0.484 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site