[PATCH] KVM: PPC: remove unneeded variable

Subsystems: kernel virtual machine for powerpc (kvm/powerpc), linux for powerpc (32-bit and 64-bit), the rest

STALE1136d

2 messages, 2 authors, 2023-06-21 · open the first message on its own page

[PATCH] KVM: PPC: remove unneeded variable

From: <hidden>
Date: 2023-06-14 06:35:59

fix the following coccicheck warning:

arch/powerpc/kvm/book3s_pr.c:424:5-6: Unneeded variable: "r".

Signed-off-by: Mingtong Bao <redacted>
---
  arch/powerpc/kvm/book3s_pr.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 9118242063fb..1b68de369b88 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -421,14 +421,13 @@ void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu)

  static int kvmppc_core_check_requests_pr(struct kvm_vcpu *vcpu)
  {
-    int r = 1; /* Indicate we want to get back into the guest */

      /* We misuse TLB_FLUSH to indicate that we want to clear
         all shadow cache entries */
      if (kvm_check_request(KVM_REQ_TLB_FLUSH, vcpu))
          kvmppc_mmu_pte_flush(vcpu, 0, 0);
-
-    return r;
+    /* Indicate we want to get back into the guest */
+    return 1;
  }

  /************* MMU Notifiers *************/

Re: [PATCH] KVM: PPC: remove unneeded variable

From: Thomas Huth <hidden>
Date: 2023-06-21 07:01:24

On 14/06/2023 07.58, baomingtong001@208suo.com wrote:
quoted hunk
fix the following coccicheck warning:

arch/powerpc/kvm/book3s_pr.c:424:5-6: Unneeded variable: "r".

Signed-off-by: Mingtong Bao <redacted>
---
  arch/powerpc/kvm/book3s_pr.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 9118242063fb..1b68de369b88 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -421,14 +421,13 @@ void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu)

  static int kvmppc_core_check_requests_pr(struct kvm_vcpu *vcpu)
  {
-    int r = 1; /* Indicate we want to get back into the guest */

      /* We misuse TLB_FLUSH to indicate that we want to clear
         all shadow cache entries */
      if (kvm_check_request(KVM_REQ_TLB_FLUSH, vcpu))
          kvmppc_mmu_pte_flush(vcpu, 0, 0);
-
-    return r;
+    /* Indicate we want to get back into the guest */
+    return 1;
  }

  /************* MMU Notifiers *************/
Please make sure to CC: linuxppc-dev@lists.ozlabs.org when sending patches 
for KVM on ppc.

Reviewed-by: Thomas Huth <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help