lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZIk9nVjY4G2xInd1@cleo>
Date:   Wed, 14 Jun 2023 14:10:05 +1000
From:   Paul Mackerras <paulus@...abs.org>
To:     baomingtong001@...suo.com
Cc:     mpe@...erman.id.au, npiggin@...il.com, christophe.leroy@...roup.eu,
        pbonzini@...hat.com, seanjc@...gle.com, thuth@...hat.com,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: PPC: remove unneeded variable

On Wed, Jun 14, 2023 at 10:34:45AM +0800, baomingtong001@...suo.com wrote:
> fix the following coccicheck warning:
> 
> arch/powerpc/kvm/book3s_pr.c:424:5-6: Unneeded variable: "r".
> 
> Signed-off-by: Mingtong Bao <baomingtong001@...suo.com>
> ---
>  arch/powerpc/kvm/book3s_pr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 9118242063fb..d03b31b240d7 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -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.

> 
>      /* 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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ