Re: [PATCH] Dynamic tick for x86 version 050602-2

From: Tony Lindgren
Date: Fri Jun 10 2005 - 10:18:20 EST


* Pavel Machek <pavel@xxxxxx> [050610 02:15]:
> Hi!
>
> > > > +#define NS_TICK_LEN ((1 * 1000000000)/HZ)
> > > > +#define DYN_TICK_MIN_SKIP 2
> > > > +
> > > > +#ifdef CONFIG_NO_IDLE_HZ
> > > > +
> > > > +extern unsigned long dyn_tick_reprogram_timer(void);
> > > > +
> > > > +#else
> > > > +
> > > > +#define arch_has_safe_halt() 0
> > > > +#define dyn_tick_reprogram_timer() {}
> > >
> > > do {} while (0)
> > >
> > > , else you are preparing trap for someone.
> >
> > Can you please explain what the difference between these two are?
> > Some compiler version specific thing?
>
> It took me quite some remembering. Problem is that with your macros,
> someone can write
>
> dyn_tick_reprogram_timer()
> printk();
>
> [notice missing ; at first line], and still get it compile. If you
> replace {} with do {} while (0), he'll get compile error as he should.

Thanks for clarifying, I'll change it.

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