diff mbox series

drm/exynos: gem: Fix sparse warning

Message ID 20200707110859.3822-1-m.szyprowski@samsung.com (mailing list archive)
State Not Applicable
Headers show
Series drm/exynos: gem: Fix sparse warning | expand

Commit Message

Marek Szyprowski July 7, 2020, 11:08 a.m. UTC
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(-)

Comments

Krzysztof Kozlowski July 9, 2020, 7:54 a.m. UTC | #1
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
Sam Ravnborg July 10, 2020, 6:30 p.m. UTC | #2
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
Marek Szyprowski July 13, 2020, 6:19 a.m. UTC | #3
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
diff mbox series

Patch

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