aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-02-19 13:25:50 -0500
committerAvi Kivity <avi@qumranet.com>2008-04-27 04:53:24 -0400
commit14af3f3c56103d8c3bb173c255ef5d89fb0c9350 (patch)
treeaee57781bbd073a123b8191ace0261f339dc06ee /arch/x86/kvm/x86.c
parent4866d5e3d59c7831c7fa117c246a39165817db0d (diff)
KVM: sparse fixes for kvm/x86.c
In two case statements, use the ever popular 'i' instead of index: arch/x86/kvm/x86.c:1063:7: warning: symbol 'index' shadows an earlier one arch/x86/kvm/x86.c:1000:9: originally declared here arch/x86/kvm/x86.c:1079:7: warning: symbol 'index' shadows an earlier one arch/x86/kvm/x86.c:1000:9: originally declared here Make it static. arch/x86/kvm/x86.c:1945:24: warning: symbol 'emulate_ops' was not declared. Should it be static? Drop the return statements. arch/x86/kvm/x86.c:2878:2: warning: returning void-valued expression arch/x86/kvm/x86.c:2944:2: warning: returning void-valued expression Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 15bba5d37931..cf6261e3d928 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1083,32 +1083,32 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1083 } 1083 }
1084 /* function 4 and 0xb have additional index. */ 1084 /* function 4 and 0xb have additional index. */
1085 case 4: { 1085 case 4: {
1086 int index, cache_type; 1086 int i, cache_type;
1087 1087
1088 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1088 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1089 /* read more entries until cache_type is zero */ 1089 /* read more entries until cache_type is zero */
1090 for (index = 1; *nent < maxnent; ++index) { 1090 for (i = 1; *nent < maxnent; ++i) {
1091 cache_type = entry[index - 1].eax & 0x1f; 1091 cache_type = entry[i - 1].eax & 0x1f;
1092 if (!cache_type) 1092 if (!cache_type)
1093 break; 1093 break;
1094 do_cpuid_1_ent(&entry[index], function, index); 1094 do_cpuid_1_ent(&entry[i], function, i);
1095 entry[index].flags |= 1095 entry[i].flags |=
1096 KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1096 KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1097 ++*nent; 1097 ++*nent;
1098 } 1098 }
1099 break; 1099 break;
1100 } 1100 }
1101 case 0xb: { 1101 case 0xb: {
1102 int index, level_type; 1102 int i, level_type;
1103 1103
1104 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1104 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1105 /* read more entries until level_type is zero */ 1105 /* read more entries until level_type is zero */
1106 for (index = 1; *nent < maxnent; ++index) { 1106 for (i = 1; *nent < maxnent; ++i) {
1107 level_type = entry[index - 1].ecx & 0xff; 1107 level_type = entry[i - 1].ecx & 0xff;
1108 if (!level_type) 1108 if (!level_type)
1109 break; 1109 break;
1110 do_cpuid_1_ent(&entry[index], function, index); 1110 do_cpuid_1_ent(&entry[i], function, i);
1111 entry[index].flags |= 1111 entry[i].flags |=
1112 KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1112 KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1113 ++*nent; 1113 ++*nent;
1114 } 1114 }
@@ -1965,7 +1965,7 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
1965} 1965}
1966EXPORT_SYMBOL_GPL(kvm_report_emulation_failure); 1966EXPORT_SYMBOL_GPL(kvm_report_emulation_failure);
1967 1967
1968struct x86_emulate_ops emulate_ops = { 1968static struct x86_emulate_ops emulate_ops = {
1969 .read_std = emulator_read_std, 1969 .read_std = emulator_read_std,
1970 .read_emulated = emulator_read_emulated, 1970 .read_emulated = emulator_read_emulated,
1971 .write_emulated = emulator_write_emulated, 1971 .write_emulated = emulator_write_emulated,
@@ -2899,7 +2899,7 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
2899static void get_segment(struct kvm_vcpu *vcpu, 2899static void get_segment(struct kvm_vcpu *vcpu,
2900 struct kvm_segment *var, int seg) 2900 struct kvm_segment *var, int seg)
2901{ 2901{
2902 return kvm_x86_ops->get_segment(vcpu, var, seg); 2902 kvm_x86_ops->get_segment(vcpu, var, seg);
2903} 2903}
2904 2904
2905void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) 2905void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
@@ -2965,7 +2965,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
2965static void set_segment(struct kvm_vcpu *vcpu, 2965static void set_segment(struct kvm_vcpu *vcpu,
2966 struct kvm_segment *var, int seg) 2966 struct kvm_segment *var, int seg)
2967{ 2967{
2968 return kvm_x86_ops->set_segment(vcpu, var, seg); 2968 kvm_x86_ops->set_segment(vcpu, var, seg);
2969} 2969}
2970 2970
2971int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, 2971int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,