[Intel-gfx] [PATCH igt 5/8] lib/igt.cocci: De-opencode ioctls
Daniel Stone
daniels at collabora.com
Thu Oct 1 09:34:05 PDT 2015
Use do_ioctl and do_ioctl_err where possible.
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
lib/igt.cocci | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lib/igt.cocci b/lib/igt.cocci
index b4f8ee4..10abd21 100644
--- a/lib/igt.cocci
+++ b/lib/igt.cocci
@@ -213,3 +213,21 @@ expression list E;
@@
-func(E);
+igt_assert_neq(func(E), -1);
+
+// replace open-coded do_ioctl
+@@
+expression a, b, c, e;
+@@
+(
+-do_or_die(drmIoctl(a, b, c));
++do_ioctl(a, b, c);
+|
+-igt_assert(drmIoctl(a, b, c) == 0);
++do_ioctl(a, b, c);
+|
+-igt_assert(drmIoctl(a, b, c) == -1 && errno == e);
++do_ioctl_err(a, b, c, e);
+|
+-igt_assert(drmIoctl(a, b, c) < 0 && errno == e);
++do_ioctl_err(a, b, c, e);
+)
--
2.5.0
More information about the Intel-gfx
mailing list