[PATCH igt 1/2] lib/sw_sync: Cleanup up error message for sw_sync_timeline_inc()

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

 



do_ioctl() generates an incompressible error string, replace with a
functio so that the assert is readable.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 lib/sw_sync.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index 9b36dd85..e691952b 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -152,9 +152,21 @@ int sw_sync_timeline_create_fence(int fd, uint32_t seqno)
 	return fence;
 }
 
+static int __sw_sync_timeline_inc(int fd, uint32_t count)
+{
+	int err;
+
+	err = 0;
+	if (igt_ioctl(fd, INT_SYNC_IOC_INC, &count))
+		err = -errno;
+
+	errno = 0;
+	return err;
+}
+
 void sw_sync_timeline_inc(int fd, uint32_t count)
 {
-	do_ioctl(fd, INT_SYNC_IOC_INC, &count);
+	igt_assert_eq(__sw_sync_timeline_inc(fd, count), 0);
 }
 
 int sync_fence_merge(int fd1, int fd2)
-- 
2.15.0.rc0

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux