lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ED3A44B.8060907@grandegger.com>
Date:	Mon, 28 Nov 2011 16:10:03 +0100
From:	Wolfgang Grandegger <wg@...ndegger.com>
To:	Marc Kleine-Budde <mkl@...gutronix.de>
CC:	David Laight <David.Laight@...LAB.COM>, netdev@...r.kernel.org,
	linux-can@...r.kernel.org, socketcan-users@...ts.berlios.de,
	IreneV <boir1@...dex.ru>,
	Stanislav Yelenskiy <stanislavelensky@...oo.com>
Subject: Re: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver
 for the CC770 and AN82527

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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ