Browse Source

qcacmn: Add API to get first node of a list

Add QDF API to get the first node of a linked list. If the
list is empty this API returns NULL.

Change-Id: I4569941f708634085904fd30a347facca543594a
CRs-Fixed: 3029987
Edayilliam Jayadev 3 năm trước cách đây
mục cha
commit
698478886e
2 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 3 0
      qdf/inc/qdf_list.h
  2. 3 0
      qdf/linux/src/i_qdf_list.h

+ 3 - 0
qdf/inc/qdf_list.h

@@ -107,6 +107,9 @@ static inline void qdf_list_create(__qdf_list_t *list, uint32_t max_size)
 #define qdf_list_for_each_from(list_ptr, cursor, node_field) \
 	__qdf_list_for_each_from(list_ptr, cursor, node_field)
 
+#define qdf_list_first_entry_or_null(list_ptr, type, node_field) \
+	__qdf_list_first_entry_or_null(list_ptr, type, node_field)
+
 /**
  * qdf_init_list_head() - initialize list head
  * @list_head: pointer to list head

+ 3 - 0
qdf/linux/src/i_qdf_list.h

@@ -97,6 +97,9 @@ static inline uint32_t __qdf_list_max_size(__qdf_list_t *list)
 #define __qdf_list_for_each_from(list_ptr, cursor, node_field) \
 	list_for_each_entry_from(cursor, &(list_ptr)->anchor, node_field)
 
+#define  __qdf_list_first_entry_or_null(list_ptr, type, node_field) \
+	list_first_entry_or_null(&(list_ptr)->anchor, type, node_field)
+
 /**
  * __qdf_init_list_head() - initialize list head
  * @list_head: pointer to list head