diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-01-16 17:09:14 -0500 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2009-01-16 18:15:31 -0500 |
| commit | 5d8b532af9e52ea89208f5ef31889f646e67ba28 (patch) | |
| tree | 9d1b4a506864bcaacf191dabc1e9823003088995 | |
| parent | 091d71e023557136e96f0e54f301497a3fc95dc3 (diff) | |
ACPI suspend: Fix compilation warnings in drivers/acpi/sleep.c
Fix two compilation warnings in drivers/acpi/sleep.c, one triggered
by unsetting CONFIG_SUSPEND and the other triggered by unsetting
CONFIG_HIBERNATION, by moving some code under the appropriate
#ifdefs .
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
| -rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 4 | ||||
| -rw-r--r-- | drivers/acpi/sleep.c | 51 |
2 files changed, 28 insertions, 27 deletions
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 707c1f6f95fa..a60c1f3bcb87 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
| @@ -156,11 +156,11 @@ static int __init acpi_sleep_setup(char *str) | |||
| 156 | #ifdef CONFIG_HIBERNATION | 156 | #ifdef CONFIG_HIBERNATION |
| 157 | if (strncmp(str, "s4_nohwsig", 10) == 0) | 157 | if (strncmp(str, "s4_nohwsig", 10) == 0) |
| 158 | acpi_no_s4_hw_signature(); | 158 | acpi_no_s4_hw_signature(); |
| 159 | if (strncmp(str, "s4_nonvs", 8) == 0) | ||
| 160 | acpi_s4_no_nvs(); | ||
| 159 | #endif | 161 | #endif |
| 160 | if (strncmp(str, "old_ordering", 12) == 0) | 162 | if (strncmp(str, "old_ordering", 12) == 0) |
| 161 | acpi_old_suspend_ordering(); | 163 | acpi_old_suspend_ordering(); |
| 162 | if (strncmp(str, "s4_nonvs", 8) == 0) | ||
| 163 | acpi_s4_no_nvs(); | ||
| 164 | str = strchr(str, ','); | 164 | str = strchr(str, ','); |
| 165 | if (str != NULL) | 165 | if (str != NULL) |
| 166 | str += strspn(str, ", \t"); | 166 | str += strspn(str, ", \t"); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 7e3c609cbef2..af85f5ba1be7 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -90,31 +90,6 @@ void __init acpi_old_suspend_ordering(void) | |||
| 90 | old_suspend_ordering = true; | 90 | old_suspend_ordering = true; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /* | ||
| 94 | * According to the ACPI specification the BIOS should make sure that ACPI is | ||
| 95 | * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, | ||
| 96 | * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI | ||
| 97 | * on such systems during resume. Unfortunately that doesn't help in | ||
| 98 | * particularly pathological cases in which SCI_EN has to be set directly on | ||
| 99 | * resume, although the specification states very clearly that this flag is | ||
| 100 | * owned by the hardware. The set_sci_en_on_resume variable will be set in such | ||
| 101 | * cases. | ||
| 102 | */ | ||
| 103 | static bool set_sci_en_on_resume; | ||
| 104 | /* | ||
| 105 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
| 106 | * and to restore them during the subsequent resume. However, it is not certain | ||
| 107 | * if this mechanism is going to work on all machines, so we allow the user to | ||
| 108 | * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line | ||
| 109 | * option. | ||
| 110 | */ | ||
| 111 | static bool s4_no_nvs; | ||
| 112 | |||
| 113 | void __init acpi_s4_no_nvs(void) | ||
| 114 | { | ||
| 115 | s4_no_nvs = true; | ||
| 116 | } | ||
| 117 | |||
| 118 | /** | 93 | /** |
| 119 | * acpi_pm_disable_gpes - Disable the GPEs. | 94 | * acpi_pm_disable_gpes - Disable the GPEs. |
| 120 | */ | 95 | */ |
| @@ -193,6 +168,18 @@ static void acpi_pm_end(void) | |||
| 193 | #endif /* CONFIG_ACPI_SLEEP */ | 168 | #endif /* CONFIG_ACPI_SLEEP */ |
| 194 | 169 | ||
| 195 | #ifdef CONFIG_SUSPEND | 170 | #ifdef CONFIG_SUSPEND |
| 171 | /* | ||
| 172 | * According to the ACPI specification the BIOS should make sure that ACPI is | ||
| 173 | * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, | ||
| 174 | * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI | ||
| 175 | * on such systems during resume. Unfortunately that doesn't help in | ||
| 176 | * particularly pathological cases in which SCI_EN has to be set directly on | ||
| 177 | * resume, although the specification states very clearly that this flag is | ||
| 178 | * owned by the hardware. The set_sci_en_on_resume variable will be set in such | ||
| 179 | * cases. | ||
| 180 | */ | ||
| 181 | static bool set_sci_en_on_resume; | ||
| 182 | |||
| 196 | extern void do_suspend_lowlevel(void); | 183 | extern void do_suspend_lowlevel(void); |
| 197 | 184 | ||
| 198 | static u32 acpi_suspend_states[] = { | 185 | static u32 acpi_suspend_states[] = { |
| @@ -396,6 +383,20 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 396 | #endif /* CONFIG_SUSPEND */ | 383 | #endif /* CONFIG_SUSPEND */ |
| 397 | 384 | ||
| 398 | #ifdef CONFIG_HIBERNATION | 385 | #ifdef CONFIG_HIBERNATION |
| 386 | /* | ||
| 387 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
| 388 | * and to restore them during the subsequent resume. However, it is not certain | ||
| 389 | * if this mechanism is going to work on all machines, so we allow the user to | ||
| 390 | * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line | ||
| 391 | * option. | ||
| 392 | */ | ||
| 393 | static bool s4_no_nvs; | ||
| 394 | |||
| 395 | void __init acpi_s4_no_nvs(void) | ||
| 396 | { | ||
| 397 | s4_no_nvs = true; | ||
| 398 | } | ||
| 399 | |||
| 399 | static unsigned long s4_hardware_signature; | 400 | static unsigned long s4_hardware_signature; |
| 400 | static struct acpi_table_facs *facs; | 401 | static struct acpi_table_facs *facs; |
| 401 | static bool nosigcheck; | 402 | static bool nosigcheck; |
