Re: [PATCH] fix and optimize clock source update

From: Andrew Morton
Date: Wed Jun 21 2006 - 17:50:00 EST


On Wed, 21 Jun 2006 23:38:32 +0200 (CEST)
Roman Zippel <zippel@xxxxxxxxxxxxxx> wrote:

> > > +#define clocksource_adjustcheck(sign, error, interval, offset) ({ \
> > > + int adj = sign; \
> > > + error >>= 2; \
> > > + if (unlikely(sign > 0 ? error > interval : error < interval)) { \
> > > + adj = clocksource_bigadjust(sign, error, \
> > > + interval, offset); \
> > > + interval <<= adj; \
> > > + offset <<= adj; \
> > > + adj = sign << adj; \
> > > + } \
> > > + adj; \
> > > +})
> >
> > That's still a #define with side effects. Yuck.
>
> The alternative is duplicating the code and an inline function which takes
> the address of these variables would likely generate worse code.

Can you verify that please? It is pretty sick.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/