Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/intel/xe_vm: initialize bind_ops.extensions field
@ 2024-08-23 11:02 Andrzej Hajda
  2024-08-23 11:54 ` Kamil Konieczny
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Andrzej Hajda @ 2024-08-23 11:02 UTC (permalink / raw)
  To: igt-dev; +Cc: Andrzej Hajda, Matthew Brost, Kamil Konieczny

Zeroing structure on allocation ensures all fields are initialized
and allows to drop 0-initialzations.

Fixes: 2e5b3647f428 ("tests/intel/xe_vm: Add bind array -ENOBUFS section")
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 tests/intel/xe_vm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index c3960fedeec7..7a8740b69627 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -917,7 +917,7 @@ test_bind_array(int fd, struct drm_xe_engine_class_instance *eci, int n_execs,
 	} *data;
 	int i, b;
 
-	bind_ops = malloc(sizeof(*bind_ops) * n_execs);
+	bind_ops = calloc(n_execs, sizeof(*bind_ops));
 	igt_assert(bind_ops);
 
 	vm = xe_vm_create(fd, 0, 0);
@@ -935,15 +935,10 @@ test_bind_array(int fd, struct drm_xe_engine_class_instance *eci, int n_execs,
 
 	for (i = 0; i < n_execs; ++i) {
 		bind_ops[i].obj = bo;
-		bind_ops[i].obj_offset = 0;
 		bind_ops[i].range = bo_size;
 		bind_ops[i].addr = addr;
 		bind_ops[i].op = DRM_XE_VM_BIND_OP_MAP;
-		bind_ops[i].flags = 0;
-		bind_ops[i].prefetch_mem_region_instance = 0;
 		bind_ops[i].pat_index = intel_get_pat_idx_wb(fd);
-		bind_ops[i].reserved[0] = 0;
-		bind_ops[i].reserved[1] = 0;
 
 		addr += bo_size;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-08-26 12:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 11:02 [PATCH] tests/intel/xe_vm: initialize bind_ops.extensions field Andrzej Hajda
2024-08-23 11:54 ` Kamil Konieczny
2024-08-23 12:49 ` ✓ CI.xeBAT: success for " Patchwork
2024-08-23 13:01 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-08-26 12:33   ` Andrzej Hajda
2024-08-23 19:57 ` ✓ CI.xeFULL: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox