From bde52d1a08a7aeb9afe1e6cf642ba764674059da Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 13 Jun 2014 15:41:28 +0200 Subject: lib/igt.cocci: Conversion to igt logging Also update old hunks to match on igt logging instead of fprintf. v2: Don't forget about perror. Signed-off-by: Daniel Vetter --- lib/igt.cocci | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/igt.cocci b/lib/igt.cocci index a5f7c2db..97aa43f9 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,25 @@ 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 E; +@@ +-perror(E); ++igt_warn(E); +@@ +expression list[n] Ep; +@@ +-fprintf(stdout, Ep); ++igt_info(Ep); +@@ +expression list[n] Ep; +@@ +-printf(Ep); ++igt_info(Ep); -- cgit v1.2.3