aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/acpi
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-03-06 16:11:59 +0100
committerJan Beulich <jbeulich@suse.com>2012-03-06 16:11:59 +0100
commitccee30d1b03707c38df5d17243025438fdc3ca21 (patch)
tree74e428bef4f957f90ae2055559fc73e39c899995 /xen/arch/x86/acpi
parenta8c276790d4f3e7936ef80892c991c0ab10505eb (diff)
downloadxen-ccee30d1b03707c38df5d17243025438fdc3ca21.tar.gz
xen-ccee30d1b03707c38df5d17243025438fdc3ca21.tar.bz2
xen-ccee30d1b03707c38df5d17243025438fdc3ca21.zip
x86/cpuidle: restrict scope of mwait_ptr in acpi_dead_idle()
... just to make sure it doesn't get used improperly (resulting from the discussion around what became c/s 24968:8964c223836c). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/acpi')
-rw-r--r--xen/arch/x86/acpi/cpu_idle.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 90168548bc..bc824e88c0 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -565,7 +565,6 @@ static void acpi_dead_idle(void)
{
struct acpi_processor_power *power;
struct acpi_processor_cx *cx;
- void *mwait_ptr;
if ( (power = processor_powers[smp_processor_id()]) == NULL )
goto default_halt;
@@ -573,10 +572,10 @@ static void acpi_dead_idle(void)
if ( (cx = &power->states[power->count-1]) == NULL )
goto default_halt;
- mwait_ptr = (void *)&mwait_wakeup(smp_processor_id());
-
if ( cx->entry_method == ACPI_CSTATE_EM_FFH )
{
+ void *mwait_ptr = &mwait_wakeup(smp_processor_id());
+
/*
* Cache must be flushed as the last operation before sleeping.
* Otherwise, CPU may still hold dirty data, breaking cache coherency,