Re: [announce] new tree: "fix all build warnings, on all configs"

Rafael J. Wysocki
2008-10-21T19:33:40Z

On Tuesday, 21 of October 2008, Ingo Molnar wrote:
>
> * Andi Kleen <andi@firstfloor.org> wrote:
>
> > > * acpi_pm_disable_gpes - Disable the GPEs.
> > > */
> > > -static int acpi_pm_disable_gpes(void)
> > > +static inline int acpi_pm_disable_gpes(void)
> >
> > Just to satisfy my curiosity, what compiler warning does marking
> > functions inline fix?
>
> the commit log below explains the situation. The warning exposed a maze
> of #ifdefs in drivers/acpi/sleep/main.c. It's not the warning we need to
> "fix" but that maze, obviously.

Thanks a lot for _not_ CCing me. :-(

> -------------------------------------------->
> From 6ddae344a73fcff60c840dd4e429bf55562b41f3 Mon Sep 17 00:00:00 2001
> From: Ingo Molnar <mingo@elte.hu>
> Date: Fri, 17 Oct 2008 15:44:22 +0200
> Subject: [PATCH] #ifdef complications in drivers/acpi/sleep/main.c
>
> this warning:
>
> drivers/acpi/sleep/main.c:67: warning: ‘acpi_pm_disable_gpes’ defined but not used
> drivers/acpi/sleep/main.c:92: warning: ‘acpi_pm_prepare’ defined but not used
> drivers/acpi/sleep/main.c:107: warning: ‘acpi_pm_finish’ defined but not used
> drivers/acpi/sleep/main.c:128: warning: ‘acpi_pm_end’ defined but not used
>
> Shows that this code has an identity crisis due to a maze of #ifdefs, in
> the PM_SLEEP && !SUSPEND && !HIBERNATION case for example.

This case is invalid, because PM_SLEEP == SUSPEND || HIBERNATION !

I don't know how you managed to get
(PM_SLEEP && !SUSPEND && !HIBERNATION), but _that_ shouldn'd be possible in the
first place.

If there are warnings in any other case, please let me know and I'll fix them,
but please don't mess up with that code like this without letting me know.

Thanks,
Rafael