Skip to contentSkip to conversation

KVM: x86: Remove unused variable rc

PATCH Applied Jiapeng Chong 2 participants 2 messages Mar 19, 2021

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

PATCH 1/1 KVM: x86: Remove unused variable rc

Fix the following coccicheck warnings:

./arch/x86/kvm/emulate.c:4985:5-7: Unneeded variable: "rc". Return "X86EMUL_CONTINUE" on line 5019.

---
 arch/x86/kvm/emulate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kvm/emulate.c +1 -3
index f7970ba..8ae1e16 100644
@@ -4982,8 +4982,6 @@ static unsigned imm_size(struct x86_emulate_ctxt *ctxt)
 static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op,
 		      unsigned size, bool sign_extension)
 {
-	int rc = X86EMUL_CONTINUE;
-
 	op->type = OP_IMM;
 	op->bytes = size;
 	op->addr.mem.ea = ctxt->_eip;
@@ -5016,7 +5014,7 @@ static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op,
 		}
 	}
 done:
-	return rc;
+	return X86EMUL_CONTINUE;
 }
 
 static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 26 lines · Jiapeng Chong

Fix the following coccicheck warnings:

./arch/x86/kvm/emulate.c:4985:5-7: Unneeded variable: "rc". Return "X86EMUL_CONTINUE" on line 5019.

---
  arch/x86/kvm/emulate.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kvm/emulate.c +0 -2
index f7970ba..8ae1e16 100644
@@ -4982,8 +4982,6 @@ static unsigned imm_size(struct x86_emulate_ctxt *ctxt)
  static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op,
  		      unsigned size, bool sign_extension)
  {
-	int rc = X86EMUL_CONTINUE;
-
  	op->type = OP_IMM;
  	op->bytes = size;
  	op->addr.mem.ea = ctxt->_eip;

arch/x86/kvm/emulate.c static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op, · line 5020

Quoted 8 lines
arch/x86/kvm/emulate.c +1 -1
@@ -5016,7 +5014,7 @@ static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op,
  		}
  	}
  done:
-	return rc;
+	return X86EMUL_CONTINUE;
  }
 
  static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,

Queued, thanks.

Paolo