[03/33] cocci: Fix bogus unused-result with _FORTIFY_SOURCE rule

Submitted by Lyude Paul on June 7, 2019, 11:07 p.m.

Details

Message ID 20190607230821.4488-3-lyude@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in IGT - Trybot

Not browsing as part of any series.

Commit Message

Lyude Paul June 7, 2019, 11:07 p.m.
From: Lyude Paul <lyude@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@redhat.com>
---
 lib/igt.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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$";