diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-17 10:27:31 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-17 10:27:31 +0100 |
commit | 2546c5a514e57c0efaeb1664006b2af14d3c0590 (patch) | |
tree | 17cef9339fdc6fb12ecf72ef27c51d96022ffed2 /include/linux/list.h | |
parent | c6a87e145cea8af8c7545a0406aa8f8dd9146c92 (diff) | |
parent | 491cc29b0a2cf7c675e94e00eed2d58934a76011 (diff) | |
download | barebox-2546c5a514e57c0efaeb1664006b2af14d3c0590.tar.gz barebox-2546c5a514e57c0efaeb1664006b2af14d3c0590.tar.xz |
Merge branch 'pu/device-cleanup' into next
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 15ed499cae..5ae90b43a3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -210,6 +210,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) { |