On Fri, Sep 19, 2025 at 02:15:29PM +0100, Tvrtko Ursulin wrote:
> No need to initialize a subset of fields to zero.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursu...@igalia.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo_util.c  | 10 ++--------
>  drivers/gpu/drm/ttm/ttm_device.c   |  5 +----
>  drivers/gpu/drm/ttm/ttm_resource.c |  5 +----
>  drivers/gpu/drm/ttm/ttm_tt.c       |  2 +-
>  4 files changed, 5 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c 
> b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index acbbca9d5c92..94a72db76f52 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -343,10 +343,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
>                          struct ttm_bo_kmap_obj *map)
>  {
>       struct ttm_resource *mem = bo->resource;
> -     struct ttm_operation_ctx ctx = {
> -             .interruptible = false,
> -             .no_wait_gpu = false
> -     };
> +     struct ttm_operation_ctx ctx = { };
>       struct ttm_tt *ttm = bo->ttm;
>       struct ttm_resource_manager *man =
>                       ttm_manager_type(bo->bdev, bo->resource->mem_type);
> @@ -530,10 +527,7 @@ int ttm_bo_vmap(struct ttm_buffer_object *bo, struct 
> iosys_map *map)
>               iosys_map_set_vaddr_iomem(map, vaddr_iomem);
>  
>       } else {
> -             struct ttm_operation_ctx ctx = {
> -                     .interruptible = false,
> -                     .no_wait_gpu = false
> -             };
> +             struct ttm_operation_ctx ctx = { };
>               struct ttm_tt *ttm = bo->ttm;
>               pgprot_t prot;
>               void *vaddr;
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c 
> b/drivers/gpu/drm/ttm/ttm_device.c
> index c3e2fcbdd2cc..00c405f1c9b8 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -134,10 +134,7 @@ static int ttm_global_init(void)
>   */
>  int ttm_device_prepare_hibernation(struct ttm_device *bdev)
>  {
> -     struct ttm_operation_ctx ctx = {
> -             .interruptible = false,
> -             .no_wait_gpu = false,
> -     };
> +     struct ttm_operation_ctx ctx = { };
>       int ret;
>  
>       do {
> diff --git a/drivers/gpu/drm/ttm/ttm_resource.c 
> b/drivers/gpu/drm/ttm/ttm_resource.c
> index b78be0c342f2..55ce363a73ae 100644
> --- a/drivers/gpu/drm/ttm/ttm_resource.c
> +++ b/drivers/gpu/drm/ttm/ttm_resource.c
> @@ -543,10 +543,7 @@ EXPORT_SYMBOL(ttm_resource_manager_init);
>  int ttm_resource_manager_evict_all(struct ttm_device *bdev,
>                                  struct ttm_resource_manager *man)
>  {
> -     struct ttm_operation_ctx ctx = {
> -             .interruptible = false,
> -             .no_wait_gpu = false,
> -     };
> +     struct ttm_operation_ctx ctx = { };
>       struct dma_fence *fence;
>       int ret;
>  
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 506e257dfba8..226d2762a1d6 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -453,7 +453,7 @@ EXPORT_SYMBOL_FOR_TESTS_ONLY(ttm_tt_unpopulate);
>  /* Test the shrinker functions and dump the result */
>  static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data)
>  {
> -     struct ttm_operation_ctx ctx = { false, false };
> +     struct ttm_operation_ctx ctx = { };
>  
>       seq_printf(m, "%d\n", ttm_global_swapout(&ctx, GFP_KERNEL));
>       return 0;
> -- 
> 2.48.0
> 

Acked-by: Thadeu Lima de Souza Cascardo <casca...@igalia.com>

Reply via email to