gpu: nvgpu: add nvgpu_list_move API

Add new API to remove a node from one list
and to add it to another head

Jira NVGPU-13

Change-Id: I1c86cde1cdfea35bd554f175b9d270a7fd4b40e5
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1454008
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Deepak Nibade
2017-03-31 15:56:15 +05:30
committed by mobile promotions
parent 0d8830394a
commit 684f7d16ef

View File

@@ -56,6 +56,12 @@ static inline int nvgpu_list_empty(struct nvgpu_list_node *head)
return head->next == head;
}
static inline void nvgpu_list_move(struct nvgpu_list_node *node, struct nvgpu_list_node *head)
{
nvgpu_list_del(node);
nvgpu_list_add(node, head);
}
#define nvgpu_list_entry(ptr, type, member) \
type ## _from_ ## member(ptr)