linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: baomingtong001@208suo.com
Cc: thuth@redhat.com, linux-kernel@vger.kernel.org,
	npiggin@gmail.com, seanjc@google.com, pbonzini@redhat.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] KVM: PPC: remove unneeded variable
Date: Wed, 14 Jun 2023 14:10:05 +1000	[thread overview]
Message-ID: <ZIk9nVjY4G2xInd1@cleo> (raw)
In-Reply-To: <de7ae31f88510a6b04f29fc01ab44854@208suo.com>

On Wed, Jun 14, 2023 at 10:34:45AM +0800, baomingtong001@208suo.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@208suo.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.

  reply	other threads:[~2023-06-14  4:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230614023206.3865-1-luojianhong@cdjrlc.com>
2023-06-14  2:34 ` [PATCH] KVM: PPC: remove unneeded variable baomingtong001
2023-06-14  4:10   ` Paul Mackerras [this message]
     [not found] <20230614055354.27565-1-luojianhong@cdjrlc.com>
2023-06-14  5:58 ` baomingtong001
2023-06-21  6:59   ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIk9nVjY4G2xInd1@cleo \
    --to=paulus@ozlabs.org \
    --cc=baomingtong001@208suo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).