OSDN Git Service
(root)
/
android-x86
/
external-libdrm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd1f372
)
list: add first/last entry macros
author
Rob Clark
<robclark@freedesktop.org>
Tue, 21 Jun 2016 15:33:30 +0000
(11:33 -0400)
committer
Rob Clark
<robclark@freedesktop.org>
Wed, 20 Jul 2016 23:42:21 +0000
(19:42 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
util_double_list.h
patch
|
blob
|
history
diff --git
a/util_double_list.h
b/util_double_list.h
index
27e0761
..
5d01f52
100644
(file)
--- a/
util_double_list.h
+++ b/
util_double_list.h
@@
-98,6
+98,12
@@
static inline void list_delinit(struct list_head *item)
#define LIST_ENTRY(__type, __item, __field) \
((__type *)(((char *)(__item)) - offsetof(__type, __field)))
+#define LIST_FIRST_ENTRY(__ptr, __type, __field) \
+ LIST_ENTRY(__type, (__ptr)->next, __field)
+
+#define LIST_LAST_ENTRY(__ptr, __type, __field) \
+ LIST_ENTRY(__type, (__ptr)->prev, __field)
+
#define LIST_IS_EMPTY(__list) \
((__list)->next == (__list))