Linux-fbdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] video: goldfishfb: remove casting dma_alloc_coherent
@ 2020-11-20  8:23 Xu Wang
  2020-11-20  9:21 ` Thomas Zimmermann
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-11-20  8:23 UTC (permalink / raw)
  To: b.zolnierkie, daniel.vetter, jani.nikula, dri-devel, linux-fbdev
  Cc: linux-kernel

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);
 	pr_debug("allocating frame buffer %d * %d, got %p\n",
 					width, height, fb->fb.screen_base);
-- 
2.17.1


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

* Re: [PATCH] video: goldfishfb: remove casting dma_alloc_coherent
  2020-11-20  8:23 [PATCH] video: goldfishfb: remove casting dma_alloc_coherent Xu Wang
@ 2020-11-20  9:21 ` Thomas Zimmermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2020-11-20  9:21 UTC (permalink / raw)
  To: Xu Wang, b.zolnierkie, daniel.vetter, jani.nikula, dri-devel,
	linux-fbdev
  Cc: linux-kernel

[-- Attachment #1.1.1: Type: text/plain, Size: 1296 bytes --]

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);
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

[-- Attachment #1.1.2: OpenPGP_0x680DC11D530B7A23.asc --]
[-- Type: application/pgp-keys, Size: 7535 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20  8:23 [PATCH] video: goldfishfb: remove casting dma_alloc_coherent Xu Wang
2020-11-20  9:21 ` Thomas Zimmermann

Linux-fbdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fbdev/0 linux-fbdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fbdev linux-fbdev/ https://lore.kernel.org/linux-fbdev \
		linux-fbdev@vger.kernel.org
	public-inbox-index linux-fbdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fbdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git