diff mbox

[06/34] ptrlist: add ptr_cur_entry() to get iterator's current entry

Message ID 20170707134002.49500-7-luc.vanoostenryck@gmail.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Luc Van Oostenryck July 7, 2017, 1:39 p.m. UTC
---
 ptrlist.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/ptrlist.h b/ptrlist.h
index e308f437c..d271f9e04 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -73,6 +73,11 @@  static inline void *__ptr_entry(const struct ptr_list *l, unsigned int i)
 	return l->list[i];
 }
 
+static inline void *ptr_cur_entry(const struct ptr_cur *cur)
+{
+	return __ptr_entry(cur->l, cur->n);
+}
+
 #define PTR_ENTRY_NOTAG(h,i)	__ptr_entry(h, i)
 #define __PTR_STRIP_TAG(ptr)	(void *)(~3UL & (unsigned long)(ptr))
 #define __PTR_KEEP_TAG(ptr)	(ptr)