linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: [PATCH] KVM: x86: remove unneeded variable
       [not found] <20230614032736.13264-1-luojianhong@cdjrlc.com>
@ 2023-06-14  3:30 ` baomingtong001
  2023-06-14 19:18   ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: baomingtong001 @ 2023-06-14  3:30 UTC (permalink / raw)
  To: tglx, mingo, bp, ave.hansen, x86, hpa; +Cc: kvm, linux-kernel

fix the following coccicheck warning:

arch/x86/kvm/emulate.c:1315:5-7: Unneeded variable: "rc".Return 
"X86EMUL_CONTINUE".
arch/x86/kvm/emulate.c:4559:5-7: Unneeded variable: "rc".Return 
"X86EMUL_CONTINUE".
arch/x86/kvm/emulate.c:1180:5-7: Unneeded variable: "rc".Return 
"X86EMUL_CONTINUE".

Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
  arch/x86/kvm/emulate.c | 15 ++++++---------
  1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 936a397a08cd..7a7e29e4e203 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1177,7 +1177,6 @@ static int decode_modrm(struct x86_emulate_ctxt 
*ctxt,
  {
      u8 sib;
      int index_reg, base_reg, scale;
-    int rc = X86EMUL_CONTINUE;
      ulong modrm_ea = 0;

      ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8); /* REX.R */
@@ -1199,16 +1198,16 @@ static int decode_modrm(struct x86_emulate_ctxt 
*ctxt,
              op->bytes = 16;
              op->addr.xmm = ctxt->modrm_rm;
              kvm_read_sse_reg(ctxt->modrm_rm, &op->vec_val);
-            return rc;
+            return X86EMUL_CONTINUE;
          }
          if (ctxt->d & Mmx) {
              op->type = OP_MM;
              op->bytes = 8;
              op->addr.mm = ctxt->modrm_rm & 7;
-            return rc;
+            return X86EMUL_CONTINUE;
          }
          fetch_register_operand(op);
-        return rc;
+        return X86EMUL_CONTINUE;
      }

      op->type = OP_MEM;
@@ -1306,13 +1305,12 @@ static int decode_modrm(struct x86_emulate_ctxt 
*ctxt,
          ctxt->memop.addr.mem.ea = (u32)ctxt->memop.addr.mem.ea;

  done:
-    return rc;
+    return X86EMUL_CONTINUE;
  }

  static int decode_abs(struct x86_emulate_ctxt *ctxt,
                struct operand *op)
  {
-    int rc = X86EMUL_CONTINUE;

      op->type = OP_MEM;
      switch (ctxt->ad_bytes) {
@@ -1327,7 +1325,7 @@ static int decode_abs(struct x86_emulate_ctxt 
*ctxt,
          break;
      }
  done:
-    return rc;
+    return X86EMUL_CONTINUE;
  }

  static void fetch_bit_operand(struct x86_emulate_ctxt *ctxt)
@@ -4556,7 +4554,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;
@@ -4590,7 +4587,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,

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

* Re: Fwd: [PATCH] KVM: x86: remove unneeded variable
  2023-06-14  3:30 ` Fwd: [PATCH] KVM: x86: remove unneeded variable baomingtong001
@ 2023-06-14 19:18   ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-06-14 19:18 UTC (permalink / raw)
  To: baomingtong001; +Cc: tglx, mingo, bp, dave.hansen, x86, hpa, kvm, linux-kernel

+Dave, -Ave

scripts/get_maintainers.pl is your friend.  It avoids typos (well, if you wrap
it with scripts instead of copy+pasting), and makes sures patches get routed to
the right folks (KVM x86 patches are routed through the KVM tree, not the tip tree).

On Wed, Jun 14, 2023, baomingtong001@208suo.com wrote:
> fix the following coccicheck warning:
> 
> arch/x86/kvm/emulate.c:1315:5-7: Unneeded variable: "rc".Return
> "X86EMUL_CONTINUE".
> arch/x86/kvm/emulate.c:4559:5-7: Unneeded variable: "rc".Return
> "X86EMUL_CONTINUE".
> arch/x86/kvm/emulate.c:1180:5-7: Unneeded variable: "rc".Return
> "X86EMUL_CONTINUE".
> 
> Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
> ---
>  arch/x86/kvm/emulate.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 936a397a08cd..7a7e29e4e203 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -1177,7 +1177,6 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
>  {
>      u8 sib;
>      int index_reg, base_reg, scale;
> -    int rc = X86EMUL_CONTINUE;
>      ulong modrm_ea = 0;
> 
>      ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8); /* REX.R */
> @@ -1199,16 +1198,16 @@ static int decode_modrm(struct x86_emulate_ctxt
> *ctxt,

Please resend, unless mine eyes deceive, this is whitespace damaged.

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

end of thread, other threads:[~2023-06-14 19:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230614032736.13264-1-luojianhong@cdjrlc.com>
2023-06-14  3:30 ` Fwd: [PATCH] KVM: x86: remove unneeded variable baomingtong001
2023-06-14 19:18   ` Sean Christopherson

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).