i965/fs: fix copy propagation of partially invalidated entries
[mesa.git] / src / util / list.h
index d4b485174fc7391fc2dde6a127e7d224dc02d75f..f0dec5da60874c7cf9e6028589e9d1f03697816b 100644 (file)
@@ -99,6 +99,14 @@ static inline bool list_empty(struct list_head *list)
    return list->next == list;
 }
 
+/**
+ * Returns whether the list has exactly one element.
+ */
+static inline bool list_is_singular(const struct list_head *list)
+{
+   return list->next != NULL && list->next->next == list;
+}
+
 static inline unsigned list_length(struct list_head *list)
 {
    struct list_head *node;