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: <20070207210201.GA4427@ingate.macqel.be>
Date:	Wed, 7 Feb 2007 22:02:01 +0100
From:	Philippe De Muyter <phdm@...qel.be>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
Cc:	Joe Perches <joe@...ches.com>, kkeil@...e.de,
	kai.germaschewski@....de, linux-kernel@...r.kernel.org,
	isdn4linux@...tserv.isdn4linux.de
Subject: Re: [PATCH 2.6.20] isdn-capi: Use ARRAY_SIZE macro when appropriate

On Wed, Feb 07, 2007 at 09:41:00PM +0200, Ahmed S. Darwish wrote:
> On Tue, Feb 06, 2007 at 10:18:14PM +0100, Philippe De Muyter wrote:
> > On Tue, Feb 06, 2007 at 10:41:30PM +0200, Ahmed S. Darwish wrote:
> > >  
> > > -    for (i=nelem-1; i >= 0; i--) {
> > > +    for (i = ARRAY_SIZE(procfsentries) - 1; i >= 0; i--) {
> > 
> > I would write such decrementing loops as :
> > 
> >        for (i = ARRAY_SIZE(procfsentries); --i >= 0; ) {
> > 
> > Long time ago, that produced better code.  I did not check recently though.
> [...]
> > > -    for (i=nelem-1; i >= 0; i--) {
> > > +    for (i = ARRAY_SIZE(procfsentries) - 1; i >= 0; i--) {
> > 
> > Same here
> 
> Hi Philippe,
> 
> Won't this hurt readability ?. I'm not a gcc guru anyway to have an
> opinion on such stuff :).

Personaly, I find it more readable, but that's a question of habit or a
matter of taste.

Philippe
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ