From af9d1b5cdb4cc506a7f171a49d1103998b5a2f9e Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 4 Nov 2013 18:11:29 +0100 Subject: [PATCH] lib: drop return value from igt_drop_caches No one actually cares, everyone expects it to just work. Signed-off-by: Daniel Vetter --- lib/igt_debugfs.c | 16 +++++----------- lib/igt_debugfs.h | 2 +- tests/gem_persistent_relocs.c | 2 +- tests/gem_reloc_vs_gpu.c | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index fc274fd..7d7f651 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 02f4afa..40d9d28 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 863f464..587af80 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 9508b1c..8a4d294 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); } } } -- 2.7.4