-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pengdeyue
committed
Aug 10, 2016
1 parent
d6cc166
commit f499e75
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// 多了一个临时变量,用来存储当前节点。 | ||
/** | ||
* list_for_each_safe - iterate over a list safe against removal of list entry | ||
* @pos: the &struct list_head to use as a loop cursor. | ||
* @n: another &struct list_head to use as temporary storage | ||
* @head: the head for your list. */ | ||
#define list_for_each_safe(pos, n, head) \ | ||
for (pos = (head)->next, n = pos->next; pos != (head); \ | ||
pos = n, n = pos->next)#define list_for_each(pos, head) \ | ||
for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | ||
pos = pos->next) |