projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22caf04
)
[PATCH] list_is_last utility
author
Shailabh Nagar
<
[email protected]
>
Fri, 14 Jul 2006 07:24:35 +0000
(
00:24
-0700)
committer
Linus Torvalds
<
[email protected]
>
Sat, 15 Jul 2006 04:53:56 +0000
(21:53 -0700)
Add another list utility function to check for last element in a list.
Signed-off-by: Shailabh Nagar <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
include/linux/list.h
patch
|
blob
|
history
diff --git
a/include/linux/list.h
b/include/linux/list.h
index 6b74adf5297f644f82531a5fbcbc55b5892d13f7..65a5b5ceda4947d1478bba79abbda826963d128e 100644
(file)
--- a/
include/linux/list.h
+++ b/
include/linux/list.h
@@
-264,6
+264,17
@@
static inline void list_move_tail(struct list_head *list,
list_add_tail(list, head);
}
+/**
+ * list_is_last - 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_is_last(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.