Commit 3bf0aa6f authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Linus Torvalds

[PATCH] hlist_for_each_safe cleanup

Make code for hlist_for_each_safe use better code (same as
hlist_for_each_entry_safe).  Get rid of comment about prefetch, because
that was fixed a while ago.  Only current use of this is in the bridge
code, that I maintain.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 27c49d8c
......@@ -620,13 +620,12 @@ static inline void hlist_add_after(struct hlist_node *n,
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
/* Cannot easily do prefetch unfortunately */
#define hlist_for_each(pos, head) \
for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
for (pos = (head)->first; n = pos ? pos->next : NULL, pos; \
for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
pos = n)
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment