All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: "Daniel Henrique Barboza" <danielhb@linux.ibm.com>,
	qemu-ppc@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	qemu-devel@nongnu.org
Subject: [PATCH v2 for-5.2 2/5] spapr/xive: Simplify kvmppc_xive_disconnect()
Date: Thu, 06 Aug 2020 18:56:13 +0200	[thread overview]
Message-ID: <159673297296.766512.14780055521619233656.stgit@bahia.lan> (raw)
In-Reply-To: <159673295739.766512.2950380687630225803.stgit@bahia.lan>

Since this function begins with:

    /* The KVM XIVE device is not in use */
    if (!xive || xive->fd == -1) {
        return;
    }

we obviously don't need to check xive->fd again.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
v2: Already applied to ppc-for-5.2 but not yet visible on github
---
 hw/intc/spapr_xive_kvm.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index d55ea4670e0e..893a1ee77e70 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -873,10 +873,8 @@ void kvmppc_xive_disconnect(SpaprInterruptController *intc)
      * and removed from the list of devices of the VM. The VCPU
      * presenters are also detached from the device.
      */
-    if (xive->fd != -1) {
-        close(xive->fd);
-        xive->fd = -1;
-    }
+    close(xive->fd);
+    xive->fd = -1;
 
     kvm_kernel_irqchip = false;
     kvm_msi_via_irqfd_allowed = false;




  parent reply	other threads:[~2020-08-06 16:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 16:55 [PATCH v2 for-5.2 0/5] papr: Cleanups for XIVE and PHB Greg Kurz
2020-08-06 16:56 ` [PATCH v2 for-5.2 1/5] spapr/xive: Fix xive->fd if kvm_create_device() fails Greg Kurz
2020-08-06 16:56 ` Greg Kurz [this message]
2020-08-06 16:56 ` [PATCH v2 for-5.2 3/5] ppc/xive: Introduce dedicated kvm_irqchip_in_kernel() wrappers Greg Kurz
2020-08-06 17:55   ` Cédric Le Goater
2020-08-07  7:15     ` Greg Kurz
2020-08-07  9:29       ` Greg Kurz
2020-08-06 16:56 ` [PATCH v2 for-5.2 4/5] spapr/xive: Convert KVM device fd checks to assert() Greg Kurz
2020-08-06 16:56 ` [PATCH v2 for-5.2 5/5] spapr: Simplify error handling in spapr_phb_realize() Greg Kurz

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=159673297296.766512.14780055521619233656.stgit@bahia.lan \
    --to=groug@kaod.org \
    --cc=clg@kaod.org \
    --cc=danielhb@linux.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.