From f457d1cb06177d6daa762dd64bf41e43e3b54ecc Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 4 Jul 2015 23:37:55 +0200 Subject: [PATCH] core: ivshmem: Simplify condition in pci_ivshmem_exit We already have the cell number available thanks to ivshmem_find and can evaluate it directly. Makes the code clearer. Signed-off-by: Jan Kiszka --- hypervisor/pci_ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypervisor/pci_ivshmem.c b/hypervisor/pci_ivshmem.c index a538ea0..8f17eef 100644 --- a/hypervisor/pci_ivshmem.c +++ b/hypervisor/pci_ivshmem.c @@ -515,7 +515,7 @@ void pci_ivshmem_exit(struct pci_device *dev) ivshmem_disconnect_cell(iv, cellnum); - if (iv->eps[0].device == dev) { + if (cellnum == 0) { if (!iv->eps[1].device) { *ivp = iv->next; page_free(&mem_pool, iv, 1); -- 2.39.2