From 5a306ebf3338fe54a3153f6de4383ca2e4d2a209 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Mon, 28 Apr 2008 02:14:27 -0700 Subject: [PATCH] --- yaml --- r: 94108 b: refs/heads/master c: 99602572812442d47403d85f376ad51298dd82a6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/list.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 16485c3861ba..0fe8916ee67e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3d8d996e0ca5b4093203d3f050b0f70b5c949ae8 +refs/heads/master: 99602572812442d47403d85f376ad51298dd82a6 diff --git a/trunk/include/linux/list.h b/trunk/include/linux/list.h index dac16f99c701..b4a939b6b625 100644 --- a/trunk/include/linux/list.h +++ b/trunk/include/linux/list.h @@ -319,6 +319,15 @@ static inline int list_empty_careful(const struct list_head *head) return (next == head) && (next == head->prev); } +/** + * list_is_singular - tests whether a list has just one entry. + * @head: the list to test. + */ +static inline int list_is_singular(const struct list_head *head) +{ + return !list_empty(head) && (head->next == head->prev); +} + static inline void __list_splice(struct list_head *list, struct list_head *head) {