Linux-Samsung-soc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] drm/exynos: gem: Fix sparse warning
       [not found] <CGME20200707110911eucas1p1e21621f402b2aac89457647c3b2ad46f@eucas1p1.samsung.com>
@ 2020-07-07 11:08 ` Marek Szyprowski
  2020-07-09  7:54   ` Krzysztof Kozlowski
  2020-07-10 18:30   ` Sam Ravnborg
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Szyprowski @ 2020-07-07 11:08 UTC (permalink / raw)
  To: dri-devel, linux-samsung-soc
  Cc: Marek Szyprowski, Bartlomiej Zolnierkiewicz, Seung-Woo Kim,
	Inki Dae, Andrzej Hajda

Add a proper cast on the exynos_gem->kvaddr assignment to avoid a sparse warning.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 9940d9d93406 ("drm/exynos: gem: Get rid of the internal 'pages' array")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index efa476858db5..65d11784f29f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -59,7 +59,7 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)
 	}
 
 	if (kvmap)
-		exynos_gem->kvaddr = exynos_gem->cookie;
+		exynos_gem->kvaddr = (void __iomem *)exynos_gem->cookie;
 
 	DRM_DEV_DEBUG_KMS(to_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
 			(unsigned long)exynos_gem->dma_addr, exynos_gem->size);
-- 
2.17.1


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

* Re: [PATCH] drm/exynos: gem: Fix sparse warning
  2020-07-07 11:08 ` [PATCH] drm/exynos: gem: Fix sparse warning Marek Szyprowski
@ 2020-07-09  7:54   ` Krzysztof Kozlowski
  2020-07-10 18:30   ` Sam Ravnborg
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-09  7:54 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: dri-devel, linux-samsung-soc, Bartlomiej Zolnierkiewicz,
	Seung-Woo Kim, Inki Dae, Andrzej Hajda

On Tue, Jul 07, 2020 at 01:08:59PM +0200, Marek Szyprowski wrote:
> Add a proper cast on the exynos_gem->kvaddr assignment to avoid a sparse warning.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 9940d9d93406 ("drm/exynos: gem: Get rid of the internal 'pages' array")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH] drm/exynos: gem: Fix sparse warning
  2020-07-07 11:08 ` [PATCH] drm/exynos: gem: Fix sparse warning Marek Szyprowski
  2020-07-09  7:54   ` Krzysztof Kozlowski
@ 2020-07-10 18:30   ` Sam Ravnborg
  2020-07-13  6:19     ` Marek Szyprowski
  1 sibling, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2020-07-10 18:30 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: dri-devel, linux-samsung-soc, Andrzej Hajda,
	Bartlomiej Zolnierkiewicz, Seung-Woo Kim

Hi Marek.

On Tue, Jul 07, 2020 at 01:08:59PM +0200, Marek Szyprowski wrote:
> Add a proper cast on the exynos_gem->kvaddr assignment to avoid a sparse warning.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 9940d9d93406 ("drm/exynos: gem: Get rid of the internal 'pages' array")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> index efa476858db5..65d11784f29f 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
> @@ -59,7 +59,7 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)
>  	}
>  
>  	if (kvmap)
> -		exynos_gem->kvaddr = exynos_gem->cookie;
> +		exynos_gem->kvaddr = (void __iomem *)exynos_gem->cookie;

From a brif look at the code the correct fix looks to me to drop the
__iomem annotation of kvaddr.
And then no cast is needed.

Care to take a look at this?

	Sam

>  
>  	DRM_DEV_DEBUG_KMS(to_dma_dev(dev), "dma_addr(0x%lx), size(0x%lx)\n",
>  			(unsigned long)exynos_gem->dma_addr, exynos_gem->size);
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/exynos: gem: Fix sparse warning
  2020-07-10 18:30   ` Sam Ravnborg
@ 2020-07-13  6:19     ` Marek Szyprowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Szyprowski @ 2020-07-13  6:19 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: dri-devel, linux-samsung-soc, Andrzej Hajda,
	Bartlomiej Zolnierkiewicz, Seung-Woo Kim

Hi Sam,

On 10.07.2020 20:30, Sam Ravnborg wrote:
> Hi Marek.
>
> On Tue, Jul 07, 2020 at 01:08:59PM +0200, Marek Szyprowski wrote:
>> Add a proper cast on the exynos_gem->kvaddr assignment to avoid a sparse warning.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Fixes: 9940d9d93406 ("drm/exynos: gem: Get rid of the internal 'pages' array")
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>   drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> index efa476858db5..65d11784f29f 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> @@ -59,7 +59,7 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem, bool kvmap)
>>   	}
>>   
>>   	if (kvmap)
>> -		exynos_gem->kvaddr = exynos_gem->cookie;
>> +		exynos_gem->kvaddr = (void __iomem *)exynos_gem->cookie;
> >From a brif look at the code the correct fix looks to me to drop the
> __iomem annotation of kvaddr.
> And then no cast is needed.
>
> Care to take a look at this?

Right, besides dropping iomem annotation, I will change fbi->screen_base 
assignment to fbi->screen_buffer. This was probably the main reason of 
this iomem annotation.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200707110911eucas1p1e21621f402b2aac89457647c3b2ad46f@eucas1p1.samsung.com>
2020-07-07 11:08 ` [PATCH] drm/exynos: gem: Fix sparse warning Marek Szyprowski
2020-07-09  7:54   ` Krzysztof Kozlowski
2020-07-10 18:30   ` Sam Ravnborg
2020-07-13  6:19     ` Marek Szyprowski

Linux-Samsung-soc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-samsung-soc/0 linux-samsung-soc/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-samsung-soc linux-samsung-soc/ https://lore.kernel.org/linux-samsung-soc \
		linux-samsung-soc@vger.kernel.org
	public-inbox-index linux-samsung-soc

Example config snippet for mirrors

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


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