[i-g-t,2/3] igt.cocci: don't use igt_assert_neq to compare pointers
diff mbox

Message ID 1431619466-3914-2-git-send-email-thomas.wood@intel.com
State New
Headers show

Commit Message

Thomas Wood May 14, 2015, 4:04 p.m. UTC
igt_assert_neq can only compare integers, not pointers.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt.cocci     | 2 +-
 tests/prime_udl.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox

diff --git a/lib/igt.cocci b/lib/igt.cocci
index f23b511..3aee72f 100644
--- a/lib/igt.cocci
+++ b/lib/igt.cocci
@@ -193,7 +193,7 @@  expression ptr, size, nmemb, stream;
 expression list E;
 @@
 -fgets(E);
-+igt_assert_neq(fgets(E), NULL);
++igt_assert(fgets(E) != NULL);
 
 @@
 identifier func =~ "^v?asprintf$";
diff --git a/tests/prime_udl.c b/tests/prime_udl.c
index d03aee0..b742f1c 100644
--- a/tests/prime_udl.c
+++ b/tests/prime_udl.c
@@ -61,7 +61,7 @@  static int find_and_open_devices(void)
 		if (!fl)
 			break;
 
-		igt_assert_neq(fgets(vendor_id, 8, fl), NULL);
+		igt_assert(fgets(vendor_id, 8, fl) != NULL);
 		fclose(fl);
 
 		venid = strtoul(vendor_id, NULL, 16);