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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux