[Patch 5/6] list_islast utility
From: Shailabh Nagar
Date: Tue Jul 11 2006 - 00:32:45 EST
Add another list utility function to check for last element in a list.
Signed-Off-By: Shailabh Nagar <nagar@xxxxxxxxxxxxxx>
include/linux/list.h | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: linux-2.6.18-rc1/include/linux/list.h
===================================================================
--- linux-2.6.18-rc1.orig/include/linux/list.h 2006-07-10 23:04:28.000000000 -0400
+++ linux-2.6.18-rc1/include/linux/list.h 2006-07-10 23:44:59.000000000 -0400
@@ -265,6 +265,17 @@ static inline void list_move_tail(struct
}
/**
+ * list_islast - tests whether @list is the last entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_islast(const struct list_head *list,
+ const struct list_head *head)
+{
+ return list->next == head;
+}
+
+/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/