Thread (2 messages) 2 messages, 2 authors, 2011-11-28

RE: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527

From: David Laight <hidden>
Date: 2011-11-28 14:03:27
Also in: linux-can

 
...
quoted
quoted
+	for (idx = 0; idx < MAXDEV; idx++) {
ARRAY_SIZE?
Well, I think ARRAY_SIZE is useful to derive the number of 
elements from a static array of the type:

  static const int array[] = { 1, 2, 3, 4, }

but not if its declared as:

  static array[MAXDEV]:

... or have I missed something?
Yes - if you use ARRAY_SIZE() then someone reading the code
doesn't need to find the array definition to ensure the loop
upper bound is correct.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help