[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/mwait: remove unneeded local variables


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Mon, 11 May 2020 12:21:28 +0200
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx; dmarc=pass (p=none dis=none) d=citrix.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 11 May 2020 10:21:58 +0000
  • Ironport-sdr: s3GUxM4AJt54wrwnnts09AYyXrm/w/IKEDf+Dtun/2y+h9eYhqDz29aWd1iyr1Tz55kF7xQoAR IJTZ/x81FD1aNKOxObvDlHutOQ+/QgJyTvlhrDdzRXO2mpkgDRt+6AOxRWOz+wen2Z/jq2ovWf mlSVTfCwyvjG6QmUTjpKrxZ8G36wU3p+UTQIe/zyVsBOjGkCz/Km2duT0Fc81us+p75qeTB/xx BpY0bcxzWHdDP12ks56kBufq4woQYwTtAWdBoANKAkNZRA44Wyy9gW+2fWkE+LBTy9GUTCEYfB YaQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Remove the eax and cstate local variables, the same can be directly
fetched from acpi_processor_cx without any transformations.

No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mwait-idle.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index bb017c488f..6d10ac32b8 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -721,7 +721,7 @@ static void mwait_idle(void)
        unsigned int cpu = smp_processor_id();
        struct acpi_processor_power *power = processor_powers[cpu];
        struct acpi_processor_cx *cx = NULL;
-       unsigned int eax, next_state, cstate;
+       unsigned int next_state;
        u64 before, after;
        u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
@@ -773,9 +773,6 @@ static void mwait_idle(void)
        if (cx->type >= 3 && errata_c6_eoi_workaround())
                cx = power->safe_state;
 
-       eax = cx->address;
-       cstate = ((eax >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
-
 #if 0 /* XXX Can we/do we need to do something similar on Xen? */
        /*
         * leave_mm() to avoid costly and often unnecessary wakeups
@@ -785,7 +782,7 @@ static void mwait_idle(void)
                leave_mm(cpu);
 #endif
 
-       if (!(lapic_timer_reliable_states & (1 << cstate)))
+       if (!(lapic_timer_reliable_states & (1 << cx->type)))
                lapic_timer_off();
 
        before = alternative_call(cpuidle_get_tick);
@@ -794,7 +791,7 @@ static void mwait_idle(void)
        update_last_cx_stat(power, cx, before);
 
        if (cpu_is_haltable(cpu))
-               mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
+               mwait_idle_with_hints(cx->address, MWAIT_ECX_INTERRUPT_BREAK);
 
        after = alternative_call(cpuidle_get_tick);
 
@@ -807,7 +804,7 @@ static void mwait_idle(void)
        update_idle_stats(power, cx, before, after);
        local_irq_enable();
 
-       if (!(lapic_timer_reliable_states & (1 << cstate)))
+       if (!(lapic_timer_reliable_states & (1 << cx->type)))
                lapic_timer_on();
 
        rcu_idle_exit(cpu);
-- 
2.26.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.