From: Thomas Gleixner on
On Mon, 10 May 2010, Benjamin Herrenschmidt wrote:
>
> +#define for_each_lmb(lmb_type, region) \
> + for (reg = lmb.lmb_type.regions; \
> + region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
> + region++)
> +

Can you please make this:

#define for_each_lmb(lmb_type, region, __iter) \
for (__iter = lmb.lmb_type.regions; \
region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
region++)

so we do not have the iterator name hardcoded inside the macro body.

Thanks,

tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Benjamin Herrenschmidt on
On Mon, 2010-05-10 at 17:39 +0200, Thomas Gleixner wrote:
> Can you please make this:
>
> #define for_each_lmb(lmb_type, region, __iter) \
> for (__iter = lmb.lmb_type.regions; \
> region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
> region++)
>
> so we do not have the iterator name hardcoded inside the macro body.

Oops, you are right, that's a thinko. I'll fix that.

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Benjamin Herrenschmidt on
On Mon, 2010-05-10 at 17:39 +0200, Thomas Gleixner wrote:
> > +#define for_each_lmb(lmb_type, region) \
> > + for (reg = lmb.lmb_type.regions; \
> > + region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
> > + region++)
> > +
>
> Can you please make this:
>
> #define for_each_lmb(lmb_type, region, __iter) \
> for (__iter = lmb.lmb_type.regions; \
> region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
> region++)
>
> so we do not have the iterator name hardcoded inside the macro body.

As a matter of fact, we didn't, but I made a typo on the first one:

- for (reg = lmb.lmb_type.regions; \
+ for (region = lmb.lmb_type.regions; \
region < (lmb.lmb_type.regions + lmb.lmb_type.cnt); \
region++)

I'll fix that in my series.

Cheers,
Ben.

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