[1/2] x86/acpi: Drop sleep_states[] and associated print messages
diff mbox series

Message ID 20190902121151.11384-1-andrew.cooper3@citrix.com
State New
Headers show
Series
  • [1/2] x86/acpi: Drop sleep_states[] and associated print messages
Related show

Commit Message

Andrew Cooper Sept. 2, 2019, 12:11 p.m. UTC
sleep_states[] is a write-only array, and despite the loop logic, the printed
message is consistently "ACPI sleep modes: S3".  Drop it all.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/acpi/power.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Jan Beulich Sept. 2, 2019, 1:52 p.m. UTC | #1
On 02.09.2019 14:11, Andrew Cooper wrote:
> sleep_states[] is a write-only array, and despite the loop logic, the printed
> message is consistently "ACPI sleep modes: S3".  Drop it all.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Albeit FTR I'm not convinced removing the log message is really a
good idea. But we can surely re-instate it if we ever mean to
support things other than S3. The only concern would be whether,
as iirc was suggested somewhere, we may want to allow suppressing
use of S3, in which case the log message might indeed be helpful
even without us supporting other sleep states.

Jan

Patch
diff mbox series

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index d83e8cdd52..6ae9e29229 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -36,7 +36,6 @@  uint32_t system_reset_counter = 1;
 static char __initdata opt_acpi_sleep[20];
 string_param("acpi_sleep", opt_acpi_sleep);
 
-static u8 sleep_states[ACPI_S_STATE_COUNT];
 static DEFINE_SPINLOCK(pm_lock);
 
 struct acpi_sleep_info acpi_sinfo;
@@ -460,7 +459,6 @@  acpi_status acpi_enter_sleep_state(u8 sleep_state)
 
 static int __init acpi_sleep_init(void)
 {
-    int i;
     char *p = opt_acpi_sleep;
 
     while ( (p != NULL) && (*p != '\0') )
@@ -474,19 +472,6 @@  static int __init acpi_sleep_init(void)
             p += strspn(p, ", \t");
     }
 
-    printk(XENLOG_INFO "ACPI sleep modes:");
-    for ( i = 0; i < ACPI_S_STATE_COUNT; i++ )
-    {
-        if ( i == ACPI_STATE_S3 )
-        {
-            sleep_states[i] = 1;
-            printk(" S%d", i);
-        }
-        else
-            sleep_states[i] = 0;
-    }
-    printk("\n");
-
     return 0;
 }
 __initcall(acpi_sleep_init);