All of lore.kernel.org
 help / color / mirror / Atom feed
* Coding style RFC: convert "for (i=0;i<ARRAY_SIZE(array);i++)" to "array_for_each(index, array)"
@ 2007-02-12 23:47 Joe Perches
  2007-02-13  0:20 ` Ben Nizette
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Joe Perches @ 2007-02-12 23:47 UTC (permalink / raw)
  To: linux-kernel

Now that most of the sizeof(array)/sizeof(array[0])
conversions have been done (there are about 800 done
and about another 130 left), perhaps it could be
useful to change the code to use a define similar
to the list_for_each

#define list_for_each(pos, head) \
	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
        	pos = pos->next)

perhaps

#define array_for_each(index, array) \
	for ((index) = 0; (index) < ARRAY_SIZE((array)); (index)++)



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

end of thread, other threads:[~2007-02-13 16:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 23:47 Coding style RFC: convert "for (i=0;i<ARRAY_SIZE(array);i++)" to "array_for_each(index, array)" Joe Perches
2007-02-13  0:20 ` Ben Nizette
2007-02-13  0:47   ` Joe Perches
2007-02-13  4:19     ` Nick Piggin
2007-02-13  7:34       ` Joe Perches
2007-02-13  7:42         ` Nick Piggin
2007-02-13 10:36           ` Bernd Petrovitsch
2007-02-13 10:54             ` Nick Piggin
2007-02-13 11:07               ` Bernd Petrovitsch
2007-02-13  7:37 ` Muli Ben-Yehuda
2007-02-13 16:28   ` Randy Dunlap
2007-02-13  7:48 ` YOSHIFUJI Hideaki / 吉藤英明

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.