mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Tim Hansen <devtimhansen@gmail.com>
Cc: rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, alexander.levin@one.verizon.com
Subject: Re: [PATCH] arch/x86: remove redundant null checks before kmem_cache_destroy
Date: Tue, 10 Oct 2017 10:40:31 +0200	[thread overview]
Message-ID: <e6500a90-1e7e-9833-b1d2-b4c2bca2582d@redhat.com> (raw)
In-Reply-To: <20171008031523.jj63si46bgb27yxu@debian>

On 08/10/2017 05:15, Tim Hansen wrote:
> Remove redundant null checks before calling kmem_cache_destroy.
> 
> Found with make coccicheck M=arch/x86/kvm on linux-next tag 
> next-20170929.
> 
> Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
> ---
>  arch/x86/kvm/mmu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index eca30c1eb1d9..a6c7177326c5 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -5463,10 +5463,8 @@ static struct shrinker mmu_shrinker = {
>  
>  static void mmu_destroy_caches(void)
>  {
> -	if (pte_list_desc_cache)
> -		kmem_cache_destroy(pte_list_desc_cache);
> -	if (mmu_page_header_cache)
> -		kmem_cache_destroy(mmu_page_header_cache);
> +	kmem_cache_destroy(pte_list_desc_cache);
> +	kmem_cache_destroy(mmu_page_header_cache);
>  }
>  
>  int kvm_mmu_module_init(void)
> 

Queued, thanks.

Paolo

      reply	other threads:[~2017-10-10  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08  3:15 Tim Hansen
2017-10-10  8:40 ` Paolo Bonzini [this message]

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=e6500a90-1e7e-9833-b1d2-b4c2bca2582d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alexander.levin@one.verizon.com \
    --cc=devtimhansen@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome