[igt-dev] [PATCH i-g-t 4/7] kms_flip: Remove unreachable condition in wait_for_events

Rodrigo Siqueira rodrigosiqueiramelo at gmail.com
Mon Mar 4 15:30:55 UTC 2019


In the function wait_for_events() has a double check in the select()
function return as described below:

  igt_assert_f(ret >= 0,
        "select error (errno %i)\n", errno);
  igt_assert_f(ret > 0,
        "select timed out or error (ret %d)\n", ret);

Note that the second assert condition will not be reached because of the
first assertion. This commit removes the code duplication and update the
error message.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo at gmail.com>
---
 tests/kms_flip.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 57138ec1..9ef77de9 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1014,9 +1014,7 @@ static unsigned int wait_for_events(struct test_output *o)
 		} while (ret < 0 && errno == EINTR);
 
 		igt_assert_f(ret >= 0,
-			     "select error (errno %i)\n", errno);
-		igt_assert_f(ret > 0,
-			     "select timed out or error (ret %d)\n", ret);
+			     "select error: %s (%d))\n", strerror(errno), ret);
 		igt_assert_f(!FD_ISSET(0, &fds),
 			     "no fds active, breaking\n");
 
-- 
2.21.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20190304/37305fa8/attachment.sig>


More information about the igt-dev mailing list