lkml.org 
[lkml]   [2016]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 11/20] hlist: Add hlist_is_last_node() helper
Required to figure out whether the entry is the last one in the hlist.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/list.h | 10 ++++++++++
1 file changed, 10 insertions(+)

Index: b/include/linux/list.h
===================================================================
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -679,6 +679,16 @@ static inline bool hlist_fake(struct hli
}

/*
+ * Check whether the node is the last node of the head without
+ * accessing head.
+ */
+static inline bool hlist_is_last_node(struct hlist_node *n,
+ struct hlist_head *h)
+{
+ return !n->next && n->pprev == &h->first;
+}
+
+/*
* Move a list from one list head to another. Fixup the pprev
* reference of the first entry if it exists.
*/

\
 
 \ /
  Last update: 2016-06-13 11:21    [W:0.185 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site