Skip to contentSkip to conversation

KVM: PPC: remove unneeded variable

PATCH In review [email protected] 2 participants 2 messages Jun 14, 2023 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 KVM: PPC: remove unneeded variable

fix the following coccicheck warning:

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

---
 arch/powerpc/kvm/book3s_pr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_pr.c +2 -2
index 9118242063fb..d03b31b240d7 100644
@@ -421,14 +421,14 @@ 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 */
+    /* 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;
+    return 1;
 }
 
 /************* MMU Notifiers *************/
#2 lore raw
Quoted 14 lines · On Wed, Jun 14, 2023 at 10:34:45AM +0800, [email protected] wrote:

fix the following coccicheck warning:

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

---
 arch/powerpc/kvm/book3s_pr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_pr.c +0 -0
index 9118242063fb..d03b31b240d7 100644

arch/powerpc/kvm/book3s_pr.c void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu) · line 424

Quoted 5 lines
arch/powerpc/kvm/book3s_pr.c +1 -1
@@ -421,14 +421,14 @@ 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 */
+    /* Indicate we want to get back into the guest */

Instead of leaving the comment here, where it makes no sense, please move it to the return statement below.

arch/powerpc/kvm/book3s_pr.c void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu) · line 434

Quoted 11 lines
arch/powerpc/kvm/book3s_pr.c +1 -1
     /* 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;
+    return 1;
 }
 
 /************* MMU Notifiers *************/

Paul.