[v2] drm/exynos: gem: Fix sparse warning

Message ID 20200713070708.30828-1-m.szyprowski@samsung.com
State New
Headers show
Series
  • [v2] drm/exynos: gem: Fix sparse warning
Related show

Commit Message

Marek Szyprowski July 13, 2020, 7:07 a.m.
kvaddr element of the exynos_gem object points to a memory buffer, thus
it should not have a __iomem annotation. Then, to avoid a warning or
casting on assignment to fbi structure, the screen_buffer element of the
union should be used instead of the screen_base.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Sam Ravnborg July 13, 2020, 4:03 p.m. | #1
On Mon, Jul 13, 2020 at 09:07:08AM +0200, Marek Szyprowski wrote:
> kvaddr element of the exynos_gem object points to a memory buffer, thus

> it should not have a __iomem annotation. Then, to avoid a warning or

> casting on assignment to fbi structure, the screen_buffer element of the

> union should be used instead of the screen_base.

> 

> Reported-by: kernel test robot <lkp@intel.com>

> Suggested-by: Sam Ravnborg <sam@ravnborg.org>

> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>


I expect one of the exynos maintianers (Inki?) to pick it up.

	Sam

> ---

>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-

>  drivers/gpu/drm/exynos/exynos_drm_gem.h   | 2 +-

>  2 files changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

> index 56a2b47e1af7..5147f5929be7 100644

> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

> @@ -92,7 +92,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,

>  	offset = fbi->var.xoffset * fb->format->cpp[0];

>  	offset += fbi->var.yoffset * fb->pitches[0];

>  

> -	fbi->screen_base = exynos_gem->kvaddr + offset;

> +	fbi->screen_buffer = exynos_gem->kvaddr + offset;

>  	fbi->screen_size = size;

>  	fbi->fix.smem_len = size;

>  

> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h

> index 7445748288da..74e926abeff0 100644

> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h

> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h

> @@ -40,7 +40,7 @@ struct exynos_drm_gem {

>  	unsigned int		flags;

>  	unsigned long		size;

>  	void			*cookie;

> -	void __iomem		*kvaddr;

> +	void			*kvaddr;

>  	dma_addr_t		dma_addr;

>  	unsigned long		dma_attrs;

>  	struct sg_table		*sgt;

> -- 

> 2.17.1

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Inki Dae July 14, 2020, 1:56 a.m. | #2
20. 7. 14. 오전 1:03에 Sam Ravnborg 이(가) 쓴 글:
> On Mon, Jul 13, 2020 at 09:07:08AM +0200, Marek Szyprowski wrote:

>> kvaddr element of the exynos_gem object points to a memory buffer, thus

>> it should not have a __iomem annotation. Then, to avoid a warning or

>> casting on assignment to fbi structure, the screen_buffer element of the

>> union should be used instead of the screen_base.

>>

>> Reported-by: kernel test robot <lkp@intel.com>

>> Suggested-by: Sam Ravnborg <sam@ravnborg.org>

>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> 

> I expect one of the exynos maintianers (Inki?) to pick it up.


Picked it up.

Thanks,
Inki Dae

> 

> 	Sam

> 

>> ---

>>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 +-

>>  drivers/gpu/drm/exynos/exynos_drm_gem.h   | 2 +-

>>  2 files changed, 2 insertions(+), 2 deletions(-)

>>

>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

>> index 56a2b47e1af7..5147f5929be7 100644

>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c

>> @@ -92,7 +92,7 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,

>>  	offset = fbi->var.xoffset * fb->format->cpp[0];

>>  	offset += fbi->var.yoffset * fb->pitches[0];

>>  

>> -	fbi->screen_base = exynos_gem->kvaddr + offset;

>> +	fbi->screen_buffer = exynos_gem->kvaddr + offset;

>>  	fbi->screen_size = size;

>>  	fbi->fix.smem_len = size;

>>  

>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h

>> index 7445748288da..74e926abeff0 100644

>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h

>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h

>> @@ -40,7 +40,7 @@ struct exynos_drm_gem {

>>  	unsigned int		flags;

>>  	unsigned long		size;

>>  	void			*cookie;

>> -	void __iomem		*kvaddr;

>> +	void			*kvaddr;

>>  	dma_addr_t		dma_addr;

>>  	unsigned long		dma_attrs;

>>  	struct sg_table		*sgt;

>> -- 

>> 2.17.1

>>

>> _______________________________________________

>> dri-devel mailing list

>> dri-devel@lists.freedesktop.org

>> https://protect2.fireeye.com/url?k=33cc4690-6e52dd7a-33cdcddf-0cc47a6cba04-3234389cf6ac8e89&q=1&u=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel

>

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 56a2b47e1af7..5147f5929be7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -92,7 +92,7 @@  static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
 	offset = fbi->var.xoffset * fb->format->cpp[0];
 	offset += fbi->var.yoffset * fb->pitches[0];
 
-	fbi->screen_base = exynos_gem->kvaddr + offset;
+	fbi->screen_buffer = exynos_gem->kvaddr + offset;
 	fbi->screen_size = size;
 	fbi->fix.smem_len = size;
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
index 7445748288da..74e926abeff0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
@@ -40,7 +40,7 @@  struct exynos_drm_gem {
 	unsigned int		flags;
 	unsigned long		size;
 	void			*cookie;
-	void __iomem		*kvaddr;
+	void			*kvaddr;
 	dma_addr_t		dma_addr;
 	unsigned long		dma_attrs;
 	struct sg_table		*sgt;