nine: use list_is_linked
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Tue, 15 Dec 2020 14:58:24 +0000 (15:58 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 18 Dec 2020 01:46:00 +0000 (01:46 +0000)
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

src/gallium/frontends/nine/basetexture9.c
src/gallium/frontends/nine/buffer9.c

index c9ef17c..c509a1f 100644 (file)
@@ -99,9 +99,9 @@ NineBaseTexture9_dtor( struct NineBaseTexture9 *This )
     pipe_sampler_view_reference(&This->view[0], NULL);
     pipe_sampler_view_reference(&This->view[1], NULL);
 
-    if (This->list.prev != NULL && This->list.next != NULL)
+    if (list_is_linked(&This->list))
         list_del(&This->list);
-    if (This->list2.prev != NULL && This->list2.next != NULL)
+    if (list_is_linked(&This->list2))
         list_del(&This->list2);
 
     NineResource9_dtor(&This->base);
index 6c2bc88..ad4e902 100644 (file)
@@ -161,9 +161,9 @@ NineBuffer9_dtor( struct NineBuffer9 *This )
     if (This->base.pool == D3DPOOL_MANAGED) {
         if (This->managed.data)
             align_free(This->managed.data);
-        if (This->managed.list.prev != NULL && This->managed.list.next != NULL)
+        if (list_is_linked(&This->managed.list))
             list_del(&This->managed.list);
-        if (This->managed.list2.prev != NULL && This->managed.list2.next != NULL)
+        if (list_is_linked(&This->managed.list2))
             list_del(&This->managed.list2);
     }