[PATCH 04/34] ptrlist: add helper __PTR_STRIP_TAG()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 ptrlist.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ptrlist.h b/ptrlist.h
index 7ecf2b529..93de46c0b 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -62,8 +62,15 @@ extern int linearize_ptr_list(struct ptr_list *, void **, int);
 #define free_ptr_list(list) \
 	do { VRFY_PTR_LIST(*(list)); __free_ptr_list((struct ptr_list **)(list)); } while (0)
 
-#define PTR_ENTRY_NOTAG(h,i)	((h)->list[i])
-#define PTR_ENTRY(h,i)	(void *)(~3UL & (unsigned long)PTR_ENTRY_NOTAG(h,i))
+static inline void *__ptr_entry(const struct ptr_list *l, unsigned int i)
+{
+	return l->list[i];
+}
+
+#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)
+#define PTR_ENTRY(h,i)		__PTR_STRIP_TAG(PTR_ENTRY_NOTAG(h,i))
 
 static inline void *first_ptr_list(struct ptr_list *list)
 {
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux