aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2012-10-04 17:48:55 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2012-10-30 23:39:46 -0200
commit47111e2cfa1a83a99ac10ed19c7c8b02be4fe973 (patch)
tree759d8a447ad6846aae1b916bf70365ac70828f89 /target-i386
parent8c723b7958127b8f204dd4b278ad3c8f6f48ae17 (diff)
i386: kvm: kvm_arch_get_supported_cpuid: use 'entry' variable
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@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/kvm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 56addf1866..18782e49db 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;
}
}