diff mbox series

video: goldfishfb: remove casting dma_alloc_coherent

Message ID 20201120082344.8623-1-vulab@iscas.ac.cn (mailing list archive)
State Superseded, archived
Headers show
Series video: goldfishfb: remove casting dma_alloc_coherent | expand

Commit Message

Xu Wang Nov. 20, 2020, 8:23 a.m. UTC
Remove casting the values returned by dma_alloc_coherent.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 drivers/video/fbdev/goldfishfb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thomas Zimmermann Nov. 20, 2020, 9:21 a.m. UTC | #1
Hi

Am 20.11.20 um 09:23 schrieb Xu Wang:
> Remove casting the values returned by dma_alloc_coherent.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
>   drivers/video/fbdev/goldfishfb.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
> index 9c83ec3f8e1f..c2f386b35617 100644
> --- a/drivers/video/fbdev/goldfishfb.c
> +++ b/drivers/video/fbdev/goldfishfb.c
> @@ -238,8 +238,7 @@ static int goldfish_fb_probe(struct platform_device *pdev)
>   	fb->fb.var.blue.length = 5;
>   
>   	framesize = width * height * 2 * 2;
> -	fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent(
> -						&pdev->dev, framesize,
> +	fb->fb.screen_base = dma_alloc_coherent(&pdev->dev, framesize,
>   						&fbpaddr, GFP_KERNEL);

But dma_alloc_coherent() returns void*. I wonder if this change wouldn't 
result in a warning from the compiler.

Best regards
Thomas

>   	pr_debug("allocating frame buffer %d * %d, got %p\n",
>   					width, height, fb->fb.screen_base);
>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index 9c83ec3f8e1f..c2f386b35617 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -238,8 +238,7 @@  static int goldfish_fb_probe(struct platform_device *pdev)
 	fb->fb.var.blue.length = 5;
 
 	framesize = width * height * 2 * 2;
-	fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent(
-						&pdev->dev, framesize,
+	fb->fb.screen_base = dma_alloc_coherent(&pdev->dev, framesize,
 						&fbpaddr, GFP_KERNEL);
 	pr_debug("allocating frame buffer %d * %d, got %p\n",
 					width, height, fb->fb.screen_base);