From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527 Date: Mon, 28 Nov 2011 16:10:03 +0100 Message-ID: <4ED3A44B.8060907@grandegger.com> References: <4ED3960F.4040508@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4ED3960F.4040508-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: socketcan-users-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org Errors-To: socketcan-users-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org To: Marc Kleine-Budde Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Laight , socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org List-Id: linux-can.vger.kernel.org On 11/28/2011 03:09 PM, Marc Kleine-Budde wrote: > On 11/28/2011 03:03 PM, David Laight wrote: >>>>> + 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. > > Yep, that > was my intention, too. OK, I see, and as we are all just human beings ... Wolfgang.