[PATCH i-g-t 03/33] cocci: Fix bogus unused-result with _FORTIFY_SOURCE rule

Lyude lyude at redhat.com
Mon Jun 10 15:02:51 UTC 2019


From: Lyude Paul <lyude at redhat.com>

We don't want to add foo == NULL to our code, since then we'll just be
adding code that will later be picked up as open-coding
igt_assert_neq(a, b).

Signed-off-by: Lyude Paul <lyude at redhat.com>
---
 lib/igt.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt.cocci b/lib/igt.cocci
index 5476b71b..20ae3cca 100644
--- a/lib/igt.cocci
+++ b/lib/igt.cocci
@@ -191,7 +191,7 @@ expression ptr, size, nmemb, stream;
 expression list E;
 @@
 -fgets(E);
-+igt_assert(fgets(E) != NULL);
++igt_assert(fgets(E));
 
 @@
 identifier func =~ "^v?asprintf$";
-- 
2.21.0



More information about the Intel-gfx-trybot mailing list