lib: drop return value from igt_drop_caches
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Nov 2013 17:11:29 +0000 (18:11 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Nov 2013 17:11:29 +0000 (18:11 +0100)
No one actually cares, everyone expects it to just work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
lib/igt_debugfs.c
lib/igt_debugfs.h
tests/gem_persistent_relocs.c
tests/gem_reloc_vs_gpu.c

index fc274fd..7d7f651 100644 (file)
@@ -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);
 }
index 02f4afa..40d9d28 100644 (file)
@@ -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__ */
index 863f464..587af80 100644 (file)
@@ -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);
                        }
                }
        }
index 9508b1c..8a4d294 100644 (file)
@@ -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);
                        }
                }
        }