hv: list: rename list_entry to container_of

This function casts a member of a structure out to the containing structure.
So rename to container_of is more readable.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-03-30 10:57:54 +08:00
committed by wenlingz
parent 1328dcb205
commit 7f342bf62f
5 changed files with 12 additions and 12 deletions

View File

@@ -108,8 +108,8 @@ static inline void list_splice_init(struct list_head *list,
}
}
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(uint64_t)(&((type *)0)->member)))
#define container_of(ptr, type, member) \
((type *)((char *)(ptr)-offsetof(type, member)))
#define list_for_each(pos, head) \
for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next)