diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-23 21:07:36 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-23 21:09:31 +0100 |
commit | d86d6eb281ba99fca1bb39ad3dc05c5681dded5d (patch) | |
tree | 86b1b07818fb10e3abd967540f8a35f62c9e7e78 /tests | |
parent | bdad74d461979a64af5633ca6909d9835d5fafbe (diff) |
Silence compiler warnings for expected and handled error conditions
Silly compiler emitting warnings that just cause people to break code
attempting to silence the compiler.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/drv_missed_irq.c | 3 | ||||
-rw-r--r-- | tests/kms_cursor_legacy.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/drv_missed_irq.c b/tests/drv_missed_irq.c index 66d20edb..d0d9b391 100644 --- a/tests/drv_missed_irq.c +++ b/tests/drv_missed_irq.c @@ -129,8 +129,9 @@ igt_simple_main fprintf(file, "0x%x", -1); fclose(file); + expect_rings = -1; file = igt_debugfs_fopen("i915_ring_test_irq", "r"); - fscanf(file, "%x", &expect_rings); + igt_ignore_warn(fscanf(file, "%x", &expect_rings)); fclose(file); igt_debug("Testing rings %x\n", expect_rings); diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c index 00890c95..d98de526 100644 --- a/tests/kms_cursor_legacy.c +++ b/tests/kms_cursor_legacy.c @@ -245,7 +245,9 @@ static void flip(struct data *data, drmModePageFlip(data->fd, crtc, fb_id, DRM_MODE_PAGE_FLIP_EVENT, NULL); - read(data->fd, buf, sizeof(buf)); + while (read(data->fd, buf, sizeof(buf)) < 0 && + (errno == EINTR || errno == EAGAIN)) + ; count++; } @@ -338,7 +340,7 @@ static void basic_flip(struct data *data) igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start); igt_set_timeout(1, "Stuck page flip"); - read(data->fd, &buf, sizeof(buf)); + igt_ignore_warn(read(data->fd, &buf, sizeof(buf))); igt_assert_eq(get_vblank(data->fd, 0, 0), vblank_start + 1); igt_reset_timeout(); |