[PATCH 03/15] i386: kvm: kvm_arch_get_supported_cpuid: use 'entry' variable

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

 



The reg switch will be moved to a separate function, so store the entry
pointer in a variable.

No behavior change, just code movement.

Signed-off-by: Eduardo Habkost <ehabkost@xxxxxxxxxx>
---
 target-i386/kvm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 9ebde66..22e8564 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -140,19 +140,20 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
     for (i = 0; i < cpuid->nent; ++i) {
         if (cpuid->entries[i].function == function &&
             cpuid->entries[i].index == index) {
+            struct kvm_cpuid_entry2 *entry = &cpuid->entries[i];
             found = true;
             switch (reg) {
             case R_EAX:
-                ret = cpuid->entries[i].eax;
+                ret = entry->eax;
                 break;
             case R_EBX:
-                ret = cpuid->entries[i].ebx;
+                ret = entry->ebx;
                 break;
             case R_ECX:
-                ret = cpuid->entries[i].ecx;
+                ret = entry->ecx;
                 break;
             case R_EDX:
-                ret = cpuid->entries[i].edx;
+                ret = entry->edx;
                 break;
             }
         }
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux