summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/igt_debugfs.c16
-rw-r--r--lib/igt_debugfs.h2
-rw-r--r--tests/gem_persistent_relocs.c2
-rw-r--r--tests/gem_reloc_vs_gpu.c2
4 files changed, 8 insertions, 14 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index fc274fd8..7d7f651b 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -321,26 +321,20 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
* Drop caches
*/
-int igt_drop_caches_set(uint64_t val)
+void igt_drop_caches_set(uint64_t val)
{
igt_debugfs_t debugfs;
int fd;
char data[19];
size_t nbytes;
- int ret = -1;
sprintf(data, "0x%" PRIx64, val);
igt_debugfs_init(&debugfs);
fd = igt_debugfs_open(&debugfs, "i915_gem_drop_caches", O_WRONLY);
- if (fd >= 0)
- {
- nbytes = write(fd, data, strlen(data) + 1);
- if (nbytes == strlen(data) + 1)
- ret = 0;
- close(fd);
- }
-
- return ret;
+ igt_assert(fd >= 0);
+ nbytes = write(fd, data, strlen(data) + 1);
+ igt_assert(nbytes == strlen(data) + 1);
+ close(fd);
}
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 02f4afa2..40d9d28f 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -92,6 +92,6 @@ void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
DROP_RETIRE | \
DROP_ACTIVE)
-int igt_drop_caches_set(uint64_t val);
+void igt_drop_caches_set(uint64_t val);
#endif /* __IGT_DEBUGFS_H__ */
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index 863f4649..587af809 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -294,7 +294,7 @@ static void do_forked_test(int fd, unsigned flags)
igt_fork_helper(&thrasher) {
while (1) {
usleep(1000);
- do_or_die(igt_drop_caches_set(val));
+ igt_drop_caches_set(val);
}
}
}
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 9508b1c9..8a4d294b 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -289,7 +289,7 @@ static void do_forked_test(int fd, unsigned flags)
igt_fork_helper(&thrasher) {
while (1) {
usleep(1000);
- do_or_die(igt_drop_caches_set(val));
+ igt_drop_caches_set(val);
}
}
}