lkml.org 
[lkml]   [2006]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fix and optimize clock source update
On Wed, 21 Jun 2006 23:38:32 +0200 (CEST)
Roman Zippel <zippel@linux-m68k.org> 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@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: 2006-06-21 23:53    [W:0.084 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site