[Intel-gfx] [PATCH 2/5] lib/igt.cocci: Conversion to igt logging

Daniel Vetter daniel.vetter at ffwll.ch
Fri Jun 13 15:47:32 CEST 2014


Also update old hunks to match on igt logging instead of fprintf.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt.cocci | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/lib/igt.cocci b/lib/igt.cocci
index a5f7c2dbfbce..9c6d0d045fac 100644
--- a/lib/igt.cocci
+++ b/lib/igt.cocci
@@ -4,7 +4,13 @@ expression Ec;
 expression list[n] Ep;
 @@
 - if (Ec) {
-- fprintf( stderr,  Ep );
+(
+- igt_warn( Ep );
+|
+- igt_info( Ep );
+|
+- igt_debug( Ep );
+)
 - igt_fail(...);
 - }
 + igt_assert_f(Ec, Ep);
@@ -16,3 +22,20 @@ expression list[n] Ep;
 - igt_skip(Ep);
 - }
 + igt_skip_on_f(Ec, Ep);
+
+// Enforce use of logging functions
+@@
+expression list[n] Ep;
+@@
+-fprintf(stderr, Ep);
++igt_warn(Ep);
+@@
+expression list[n] Ep;
+@@
+-fprintf(stdout, Ep);
++igt_info(Ep);
+@@
+expression list[n] Ep;
+@@
+-printf(Ep);
++igt_info(Ep);
-- 
2.0.0




More information about the Intel-gfx mailing list