Skip to content

Commit ea55d5a

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Delete pointless switch statement in kvm_reset_vcpu()
The vCPU target hasn't mattered for quite a long time now. Delete the useless switch statement in kvm_reset_vcpu(), which hilariously only had a default case in it. Reviewed-by: Zenghui Yu <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 06c2afb commit ea55d5a

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

arch/arm64/kvm/reset.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -248,21 +248,16 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
248248
}
249249
}
250250

251-
switch (vcpu->arch.target) {
252-
default:
253-
if (vcpu_el1_is_32bit(vcpu)) {
254-
pstate = VCPU_RESET_PSTATE_SVC;
255-
} else if (vcpu_has_nv(vcpu)) {
256-
pstate = VCPU_RESET_PSTATE_EL2;
257-
} else {
258-
pstate = VCPU_RESET_PSTATE_EL1;
259-
}
260-
261-
if (kvm_vcpu_has_pmu(vcpu) && !kvm_arm_support_pmu_v3()) {
262-
ret = -EINVAL;
263-
goto out;
264-
}
265-
break;
251+
if (vcpu_el1_is_32bit(vcpu))
252+
pstate = VCPU_RESET_PSTATE_SVC;
253+
else if (vcpu_has_nv(vcpu))
254+
pstate = VCPU_RESET_PSTATE_EL2;
255+
else
256+
pstate = VCPU_RESET_PSTATE_EL1;
257+
258+
if (kvm_vcpu_has_pmu(vcpu) && !kvm_arm_support_pmu_v3()) {
259+
ret = -EINVAL;
260+
goto out;
266261
}
267262

268263
/* Reset core registers */

0 commit comments

Comments
 (0)