drm: verisilicon: vs_gem: Fix wrong return type with gcc14 23/312223/1 accepted/tizen/unified/toolchain/20240610.172832 accepted/tizen/unified/x/20240610.223411
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 5 Jun 2024 06:09:45 +0000 (15:09 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 5 Jun 2024 06:14:30 +0000 (15:14 +0900)
The retrun value of vmap callback is using to check if there is an
error. If error is not existed, the checking iosys_map is null or not
with iosys_map_is_null().

[  273s] drivers/gpu/drm/verisilicon/vs_gem.c: In function 'vs_gem_prime_vmap':
[  273s] drivers/gpu/drm/verisilicon/vs_gem.c:388:53: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
[  273s]   387 |         return vs_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING ?
[  273s]       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  273s]   388 |                        page_address(vs_obj->cookie) :
[  273s]       |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
[  273s]   389 |                        vs_obj->cookie;
[  273s]       |                        ~~~~~~~~~~~~~~
[  273s]   AR      drivers/misc/lis3lv02d/built-in.a

Change-Id: I22dea91de15eb1e75d0591d26fe50df1d003e658
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/gpu/drm/verisilicon/vs_gem.c

index 6233d6d95fbd75ccb4504b5ec7ca9155d9a8acd9..c5b5d2016e0dc8abf77afa58fa7ab45fdd8acbe4 100644 (file)
@@ -384,9 +384,13 @@ static int vs_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
 {
        struct vs_gem_object *vs_obj = to_vs_gem_object(obj);
 
-       return vs_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING ?
+       void *vaddr = vs_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING ?
                       page_address(vs_obj->cookie) :
                       vs_obj->cookie;
+
+       iosys_map_set_vaddr(map, vaddr);
+
+       return 0;
 }
 
 static void vs_gem_prime_vunmap(struct drm_gem_object *obj,