lib: drop return value from igt_drop_caches

No one actually cares, everyone expects it to just work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2013-11-04 18:11:29 +01:00
parent 5f0ab94c3f
commit af9d1b5cdb
4 changed files with 8 additions and 14 deletions

View File

@ -321,26 +321,20 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
* Drop caches * Drop caches
*/ */
int igt_drop_caches_set(uint64_t val) void igt_drop_caches_set(uint64_t val)
{ {
igt_debugfs_t debugfs; igt_debugfs_t debugfs;
int fd; int fd;
char data[19]; char data[19];
size_t nbytes; size_t nbytes;
int ret = -1;
sprintf(data, "0x%" PRIx64, val); sprintf(data, "0x%" PRIx64, val);
igt_debugfs_init(&debugfs); igt_debugfs_init(&debugfs);
fd = igt_debugfs_open(&debugfs, "i915_gem_drop_caches", O_WRONLY); fd = igt_debugfs_open(&debugfs, "i915_gem_drop_caches", O_WRONLY);
if (fd >= 0) igt_assert(fd >= 0);
{ nbytes = write(fd, data, strlen(data) + 1);
nbytes = write(fd, data, strlen(data) + 1); igt_assert(nbytes == strlen(data) + 1);
if (nbytes == strlen(data) + 1) close(fd);
ret = 0;
close(fd);
}
return ret;
} }

View File

@ -92,6 +92,6 @@ void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
DROP_RETIRE | \ DROP_RETIRE | \
DROP_ACTIVE) DROP_ACTIVE)
int igt_drop_caches_set(uint64_t val); void igt_drop_caches_set(uint64_t val);
#endif /* __IGT_DEBUGFS_H__ */ #endif /* __IGT_DEBUGFS_H__ */

View File

@ -294,7 +294,7 @@ static void do_forked_test(int fd, unsigned flags)
igt_fork_helper(&thrasher) { igt_fork_helper(&thrasher) {
while (1) { while (1) {
usleep(1000); usleep(1000);
do_or_die(igt_drop_caches_set(val)); igt_drop_caches_set(val);
} }
} }
} }

View File

@ -289,7 +289,7 @@ static void do_forked_test(int fd, unsigned flags)
igt_fork_helper(&thrasher) { igt_fork_helper(&thrasher) {
while (1) { while (1) {
usleep(1000); usleep(1000);
do_or_die(igt_drop_caches_set(val)); igt_drop_caches_set(val);
} }
} }
} }