mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hlist_for_each_safe cleanup
@ 2004-07-23 21:05 Stephen Hemminger
  2004-07-23 21:22 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2004-07-23 21:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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: Stephen Hemminger <shemminger@osdl.org>

--- linux-2.6/include/linux/list.h	2004-07-23 09:36:18.000000000 -0700
+++ tcp-2.6/include/linux/list.h	2004-07-23 11:43:25.000000000 -0700
@@ -620,13 +620,12 @@
 
 #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)
 
 /**

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-25  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-23 21:05 [PATCH] hlist_for_each_safe cleanup Stephen Hemminger
2004-07-23 21:22 ` Andreas Schwab
2004-07-23 22:56   ` Stephen Hemminger
2004-07-23 23:13     ` Andreas Schwab
2004-07-25  9:32     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®