Skip to content

Commit

Permalink
spapr/xive: Simplify kvmppc_xive_disconnect()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gkurz authored and dgibson committed Aug 12, 2020
1 parent 82f086b commit e781139
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hw/intc/spapr_xive_kvm.c
Expand Up @@ -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;
Expand Down

0 comments on commit e781139

Please sign in to comment.