Mesa (master): util/list: use helper function in list_is_singular

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 18 02:04:48 UTC 2020


Module: Mesa
Branch: master
Commit: 5f2166525fe58c94f297b5985bf993867313565a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f2166525fe58c94f297b5985bf993867313565a

Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date:   Tue Dec 15 16:06:57 2020 +0100

util/list: use helper function in list_is_singular

Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>

---

 src/util/list.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/list.h b/src/util/list.h
index 9de8a2842bc..0e71a66a7d5 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -124,7 +124,7 @@ static inline bool list_is_linked(const struct list_head *list)
  */
 static inline bool list_is_singular(const struct list_head *list)
 {
-   return list_is_linked(list) && list->next != list && list->next->next == list;
+   return list_is_linked(list) && !list_is_empty(list) && list->next->next == list;
 }
 
 static inline unsigned list_length(const struct list_head *list)



More information about the mesa-commit mailing list