aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/list.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index dac16f99c701..b4a939b6b625 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -319,6 +319,15 @@ static inline int list_empty_careful(const struct list_head *head)
319 return (next == head) && (next == head->prev); 319 return (next == head) && (next == head->prev);
320} 320}
321 321
322/**
323 * list_is_singular - tests whether a list has just one entry.
324 * @head: the list to test.
325 */
326static inline int list_is_singular(const struct list_head *head)
327{
328 return !list_empty(head) && (head->next == head->prev);
329}
330
322static inline void __list_splice(struct list_head *list, 331static inline void __list_splice(struct list_head *list,
323 struct list_head *head) 332 struct list_head *head)
324{ 333{