Use do_ioctl and do_ioctl_err where possible. Signed-off-by: Daniel Stone <daniels@xxxxxxxxxxxxx> --- 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx