From 802620f5a9cf7231933cfce61817577b3b6543d9 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Fri, 19 Sep 2025 14:15:29 +0100 Subject: [PATCH] drm/ttm: Tidy ttm_operation_ctx initialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No need to initialize a subset of fields to zero. Signed-off-by: Tvrtko Ursulin Acked-by: Thadeu Lima de Souza Cascardo Link: https://lore.kernel.org/r/20250919131530.91247-4-tvrtko.ursulin@igalia.com Reviewed-by: Christian König Signed-off-by: Tvrtko Ursulin [tursulin: fixup conflict in ttm_resource_manager_evict_all] --- 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 2ff35d55e462f..c00371894fa1d 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 9a51afaf0749e..d3bfb9a696a74 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -135,10 +135,7 @@ out: */ 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 2dd19f229d32b..a31683f7f3108 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -545,10 +545,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, i; diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 611d20ab966d2..af33fa0202496 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -456,7 +456,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.47.3