Re: [PATCH v2] ACPI: move acpi_no_s4_hw_signature() declaration into#ifdef CONFIG_HIBERNATION

From: Yuanhan Liu
Date: Tue Oct 16 2012 - 03:21:43 EST


On Tue, Oct 16, 2012 at 02:24:53PM +0800, Fengguang Wu wrote:
> On Tue, Oct 16, 2012 at 01:24:12PM +0800, Yuanhan Liu wrote:
> > acpi_no_s4_hw_signature is defined in #ifdef CONFIG_HIBERNATION block,
> > but the current code put the declaration in #ifdef CONFIG_PM_SLEEP block.
> >
> > I happened to meet this issue when I turned off PM_SLEEP config manually:
> > arch/x86/kernel/acpi/sleep.c:100:4: error: implicit declaration of function âacpi_no_s4_hw_signatureâ [-Werror=implicit-function-declaration]
>
> This should be more clear:
>
> Fix build error on !CONFIG_PM_SLEEP:

Actually, there are more erros besides the followling one on !CONFIG_PM_SLEEP.
This patch just fix one obvious one: the logical is wrong.

Thanks,
Yuanhan Liu
>
> arch/x86/kernel/acpi/sleep.c:100:4: error: implicit declaration of function âacpi_no_s4_hw_signatureâ
>
> The root cause is, acpi_no_s4_hw_signature() is defined in
> #ifdef CONFIG_HIBERNATION block, but the current code put the
> declaration in #ifdef CONFIG_PM_SLEEP block.
>
> Thanks,
> Fengguang
>
> > v2: take better title and add build error message suggested by Fengguang
> >
> > Signed-off-by: Yuanhan Liu <yuanhan.liu@xxxxxxxxxxxxxxx>
> > Reviewed-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
> > ---
> > include/linux/acpi.h | 5 ++++-
> > 1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> > index 90be989..a468429 100644
> > --- a/include/linux/acpi.h
> > +++ b/include/linux/acpi.h
> > @@ -257,8 +257,11 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
> >
> > int acpi_resources_are_enforced(void);
> >
> > -#ifdef CONFIG_PM_SLEEP
> > +#ifdef CONFIG_HIBERNATION
> > void __init acpi_no_s4_hw_signature(void);
> > +#endif
> > +
> > +#ifdef CONFIG_PM_SLEEP
> > void __init acpi_old_suspend_ordering(void);
> > void __init acpi_nvs_nosave(void);
> > #endif /* CONFIG_PM_SLEEP */
> > --
> > 1.7.7.6
--
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/