lkml.org 
[lkml]   [2007]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2.6.20] isdn-capi: Use ARRAY_SIZE macro when appropriate
From
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 :).

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

\
 
 \ /
  Last update: 2007-02-07 20:45    [W:0.082 / U:2.480 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site