qcacmn: Abstract qdf_mem_validate_list_node()

Currently qdf_mem contains a function, qdf_mem_validate_list_node(), for
validating a list node and ensuring it is currently part of a list.
Instead, abstract this function from qdf_mem, and move the definition to
qdf_list_node_in_any_list() in qdf_list. This is a more reasonable
location for the list-specific logic, and allows its reuse by other
callers.

Change-Id: I56a5d54e3c81470a111f168533faedf7fa525ff3
CRs-Fixed: 2359358
This commit is contained in:
Dustin Brown
2018-11-30 12:38:07 -08:00
committed by nshrivas
父節點 c2cc252d18
當前提交 40bd452c5b
共有 4 個文件被更改,包括 53 次插入46 次删除

查看文件

@@ -161,4 +161,25 @@ QDF_STATUS qdf_list_remove_node(qdf_list_t *list,
bool qdf_list_empty(qdf_list_t *list);
/**
* qdf_list_has_node() - check if a node is in a list
* @list: pointer to the list being searched
* @node: pointer to the node to search for
*
* This API has a time complexity of O(n).
*
* Return: true if the node is in the list
*/
bool qdf_list_has_node(qdf_list_t *list, qdf_list_node_t *node);
/**
* qdf_list_node_in_any_list() - ensure @node is a member of a list
* @node: list node to check
*
* This API has a time complexity of O(1). See also qdf_list_has_node().
*
* Return: true, if @node appears to be in a list
*/
bool qdf_list_node_in_any_list(const qdf_list_node_t *node);
#endif /* __QDF_LIST_H */