Skip to contentSkip to conversation

KVM: remove useless check of "ret" variable prior to returning the same value

RFC PATCH In review Eugene Korenevsky 2 participants 2 messages Mar 28, 2015 – Mar 30, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 KVM: remove useless check of "ret" variable prior to returning the same value

A trivial code cleanup. This if is redundant.

---
 arch/x86/kvm/emulate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kvm/emulate.c +1 -3
index 106c015..3a494f3 100644
@@ -2782,10 +2782,8 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt,
 		return ret;
 	ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl,
 					X86_TRANSFER_TASK_SWITCH, NULL);
-	if (ret != X86EMUL_CONTINUE)
-		return ret;
 
-	return X86EMUL_CONTINUE;
+	return ret;
 }
 
 static int task_switch_32(struct x86_emulate_ctxt *ctxt,
Signature · 1 line
2.0.5
maintainer
#1 lore raw
Quoted 14 lines · Eugene Korenevsky

A trivial code cleanup. This if is redundant.

---
 arch/x86/kvm/emulate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kvm/emulate.c +0 -0
index 106c015..3a494f3 100644
@@ -2782,10 +2782,8 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt,
 		return ret;

arch/x86/kvm/emulate.c static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, · line 2789

Quoted 10 lines
arch/x86/kvm/emulate.c +1 -3
 	ret = __load_segment_descriptor(ctxt, tss->gs, VCPU_SREG_GS, cpl,
 					X86_TRANSFER_TASK_SWITCH, NULL);
-	if (ret != X86EMUL_CONTINUE)
-		return ret;
 
-	return X86EMUL_CONTINUE;
+	return ret;
 }
 
 static int task_switch_32(struct x86_emulate_ctxt *ctxt,

Applied this one for now.

Paolo