From: Dexuan Cui Date: Thu, 15 Mar 2018 14:21:43 +0000 (+0000) Subject: PCI: hv: Remove the bogus test in hv_eject_device_work() X-Git-Tag: v5.15~9091^2~6^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fca288c0153b2b97114b9081bc3c33c3735145b6;p=platform%2Fkernel%2Flinux-starfive.git PCI: hv: Remove the bogus test in hv_eject_device_work() When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. Signed-off-by: Dexuan Cui [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley Acked-by: Haiyang Zhang Cc: Vitaly Kuznetsov Cc: Jack Morgenstein Cc: Stephen Hemminger Cc: K. Y. Srinivasan --- diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 0d2a098..0dc2ecd 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -1842,10 +1842,7 @@ static void hv_eject_device_work(struct work_struct *work) hpdev = container_of(work, struct hv_pci_dev, wrk); - if (hpdev->state != hv_pcichild_ejecting) { - put_pcichild(hpdev, hv_pcidev_ref_pnp); - return; - } + WARN_ON(hpdev->state != hv_pcichild_ejecting); /* * Ejection can come before or after the PCI bus has been set up, so