From: Andrzej Hajda <andrzej.hajda@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH] tests/intel/xe_vm: initialize bind_ops.extensions field
Date: Fri, 23 Aug 2024 13:02:21 +0200 [thread overview]
Message-ID: <20240823110221.68234-1-andrzej.hajda@intel.com> (raw)
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
next reply other threads:[~2024-08-23 11:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 11:02 Andrzej Hajda [this message]
2024-08-23 11:54 ` [PATCH] tests/intel/xe_vm: initialize bind_ops.extensions field 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240823110221.68234-1-andrzej.hajda@intel.com \
--to=andrzej.hajda@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=matthew.brost@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox