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

Tony Lindgren
2005-06-10T15:17:26Z

* Pavel Machek <pavel@ucw.cz> [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