Re: [PATCH 1/8] PM: Add suspend block api.

Rafael J. Wysocki
2009-05-02T12:17:52Z

On Sunday 26 April 2009, Pavel Machek wrote:
> Hi!
>
> > >> --- a/kernel/power/power.h
> > >> +++ b/kernel/power/power.h
> > >> @@ -223,3 +223,9 @@ static inline void suspend_thaw_processes(void)
> > >> {
> > >> }
> > >> #endif
> > >> +
> > >> +#ifdef CONFIG_SUSPEND_BLOCK
> > >> +/* kernel/power/suspend_block.c */
> > >> +void request_suspend_state(suspend_state_t state);
> > >> +#endif
> > >
> > > Is the #ifdef really necessary?
> > >
> >
> > No, but it gives a compile error instead of a link error if you call
> > request_suspend_state when it is not available so it is useful.
>
> I believe #ifdef is too ugly and link error is really good enough.

Well, I agree with this FWIW.

We don't ususally use #ifdefs around function headers, unless they are defined
conditionally.

Thanks,
Rafael