提交 462885e6 编写于 作者: B Bernard Xiong

[Kernel] rename list_for_each/list_first_entry.

上级 b1f15366
...@@ -114,25 +114,25 @@ rt_inline int rt_list_isempty(const rt_list_t *l) ...@@ -114,25 +114,25 @@ rt_inline int rt_list_isempty(const rt_list_t *l)
((type *)((char *)(node) - (unsigned long)(&((type *)0)->member))) ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))
/** /**
* list_for_each_entry - iterate over list of given type * rt_list_for_each_entry - iterate over list of given type
* @pos: the type * to use as a loop cursor. * @pos: the type * to use as a loop cursor.
* @head: the head for your list. * @head: the head for your list.
* @member: the name of the list_struct within the struct. * @member: the name of the list_struct within the struct.
*/ */
#define list_for_each_entry(pos, head, member) \ #define rt_list_for_each_entry(pos, head, member) \
for (pos = rt_list_entry((head)->next, typeof(*pos), member); \ for (pos = rt_list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \ &pos->member != (head); \
pos = rt_list_entry(pos->member.next, typeof(*pos), member)) pos = rt_list_entry(pos->member.next, typeof(*pos), member))
/** /**
* list_first_entry - get the first element from a list * rt_list_first_entry - get the first element from a list
* @ptr: the list head to take the element from. * @ptr: the list head to take the element from.
* @type: the type of the struct this is embedded in. * @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct. * @member: the name of the list_struct within the struct.
* *
* Note, that list is expected to be not empty. * Note, that list is expected to be not empty.
*/ */
#define list_first_entry(ptr, type, member) \ #define rt_list_first_entry(ptr, type, member) \
rt_list_entry((ptr)->next, type, member) rt_list_entry((ptr)->next, type, member)
/*@}*/ /*@}*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册