linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Remove unused variable rc
@ 2021-03-19  8:53 Jiapeng Chong
  2021-03-19  9:30 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-03-19  8:53 UTC (permalink / raw)
  To: pbonzini
  Cc: seanjc, vkuznets, wanpengli, jmattson, joro, tglx, mingo, bp,
	x86, hpa, kvm, linux-kernel, Jiapeng Chong

Fix the following coccicheck warnings:

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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 arch/x86/kvm/emulate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index f7970ba..8ae1e16 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -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,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: Remove unused variable rc
  2021-03-19  8:53 [PATCH] KVM: x86: Remove unused variable rc Jiapeng Chong
@ 2021-03-19  9:30 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-03-19  9:30 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: seanjc, vkuznets, wanpengli, jmattson, joro, tglx, mingo, bp,
	x86, hpa, kvm, linux-kernel

On 19/03/21 09:53, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:
> 
> ./arch/x86/kvm/emulate.c:4985:5-7: Unneeded variable: "rc". Return
> "X86EMUL_CONTINUE" on line 5019.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>   arch/x86/kvm/emulate.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index f7970ba..8ae1e16 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -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,
> 

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-19  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19  8:53 [PATCH] KVM: x86: Remove unused variable rc Jiapeng Chong
2021-03-19  9:30 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).