lkml.org 
[lkml]   [2004]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] hlist_for_each_safe cleanup
From
Date
Stephen Hemminger <shemminger@osdl.org> writes:

> --- 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; }); \

What's wrong with using the comma operator instead of non-standard
statement expressions?

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.032 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site