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] [day] [month] [year] [list]
Date:	Mon, 28 Jan 2008 01:41:11 -0800
From:	David Brownell <david-b@...bell.net>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Haavard Skinnemoen <hskinnemoen@...el.com>,
	Andrew Victor <linux@...im.org.za>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Patrice Vilchez <patrice.vilchez@....atmel.com>,
	Richard Purdie <rpurdie@...ys.net>,
	linux-kernel@...r.kernel.org, kernel@...32linux.org
Subject: Re: [PATCH -mm 2/2] PWM LED driver

On Monday 28 January 2008, Andrew Morton wrote:
> > -     if (i > 0) {
> > -             for (i = i - 1; i >= 0; i--) {
> > -                     led_classdev_unregister(&leds[i].cdev);
> > -                     pwm_channel_free(&leds[i].pwmc);
> > -             }
> > +     while (i-- > 0) {
> > +             led_classdev_unregister(&leds[i].cdev);
> > +             pwm_channel_free(&leds[i].pwmc);
> >       }
> 
> Looks OK, although I'd say that `while (--i >= 0)' is more idiomatic -
> predecrement, postincrement and all that?

Except for the "unsigned i;" declaration earlier... given that,
"while (true) cpu_relax();" becomes maximally idiomatic.  :)

Odd how PDP-11 idioms linger.  Just because C was designed on
that processor ...


--
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