WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2/7] tboot: Add return values for tboot_sleep

. as appropiately. As tboot_sleep now returns values, we are free
to remove the tboot_sleep_wrapper function altogether.

Suggested-by: "Rafael J. Wysocki" <rjw@xxxxxxx>
CC: Joseph Cihula <joseph.cihula@xxxxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 arch/x86/kernel/tboot.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 751d673..5ab5362 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -273,7 +273,8 @@ static void tboot_copy_fadt(const struct acpi_table_fadt 
*fadt)
                offsetof(struct acpi_table_facs, firmware_waking_vector);
 }
 
-void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
+static acpi_status tboot_sleep(u8 sleep_state, u32 pm1a_control,
+                              u32 pm1b_control)
 {
        static u32 acpi_shutdown_map[ACPI_S_STATE_COUNT] = {
                /* S0,1,2: */ -1, -1, -1,
@@ -282,7 +283,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 
pm1b_control)
                /* S5: */ TB_SHUTDOWN_S5 };
 
        if (!tboot_enabled())
-               return;
+               return AE_OK;
 
        tboot_copy_fadt(&acpi_gbl_FADT);
        tboot->acpi_sinfo.pm1a_cnt_val = pm1a_control;
@@ -293,10 +294,12 @@ void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 
pm1b_control)
        if (sleep_state >= ACPI_S_STATE_COUNT ||
            acpi_shutdown_map[sleep_state] == -1) {
                pr_warning("unsupported sleep state 0x%x\n", sleep_state);
-               return;
+               return AE_ERROR;
        }
 
        tboot_shutdown(acpi_shutdown_map[sleep_state]);
+
+       return AE_OK;
 }
 static acpi_status tboot_sleep_wrapper(u8 sleep_state, u32 pm1a_control,
                u32 pm1b_control)
@@ -353,7 +356,7 @@ static __init int tboot_late_init(void)
        atomic_set(&ap_wfs_count, 0);
        register_hotcpu_notifier(&tboot_cpu_notifier);
 
-       acpi_os_prepare_sleep_register(&tboot_sleep_wrapper);
+       acpi_os_prepare_sleep_register(&tboot_sleep);
        return 0;
 }
 
-- 
1.7.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel