]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
spapr/xive: Simplify kvmppc_xive_disconnect()
authorGreg Kurz <groug@kaod.org>
Thu, 6 Aug 2020 16:56:13 +0000 (18:56 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 12 Aug 2020 03:16:27 +0000 (13:16 +1000)
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>
Message-Id: <159673297296.766512.14780055521619233656.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/spapr_xive_kvm.c

index d55ea4670e0ec7d7595191db3401d38081f0e652..893a1ee77e701c6f08073ed7d715b16a7ef78587 100644 (file)
@@ -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;