PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev
commit add9195e69c94b32e96f78c2f9cea68f0e850b3f upstream. The hpdev->state is never really useful. The only use in hv_pci_eject_device() and hv_eject_device_work() is not really necessary. Signed-off-by: Dexuan Cui <decui@microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Acked-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230615044451.5580-4-decui@microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8b74846769
commit
8f2d5ebdfe
@ -520,19 +520,10 @@ struct hv_dr_state {
|
|||||||
struct hv_pcidev_description func[];
|
struct hv_pcidev_description func[];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum hv_pcichild_state {
|
|
||||||
hv_pcichild_init = 0,
|
|
||||||
hv_pcichild_requirements,
|
|
||||||
hv_pcichild_resourced,
|
|
||||||
hv_pcichild_ejecting,
|
|
||||||
hv_pcichild_maximum
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hv_pci_dev {
|
struct hv_pci_dev {
|
||||||
/* List protected by pci_rescan_remove_lock */
|
/* List protected by pci_rescan_remove_lock */
|
||||||
struct list_head list_entry;
|
struct list_head list_entry;
|
||||||
refcount_t refs;
|
refcount_t refs;
|
||||||
enum hv_pcichild_state state;
|
|
||||||
struct pci_slot *pci_slot;
|
struct pci_slot *pci_slot;
|
||||||
struct hv_pcidev_description desc;
|
struct hv_pcidev_description desc;
|
||||||
bool reported_missing;
|
bool reported_missing;
|
||||||
@ -2378,8 +2369,6 @@ static void hv_eject_device_work(struct work_struct *work)
|
|||||||
hpdev = container_of(work, struct hv_pci_dev, wrk);
|
hpdev = container_of(work, struct hv_pci_dev, wrk);
|
||||||
hbus = hpdev->hbus;
|
hbus = hpdev->hbus;
|
||||||
|
|
||||||
WARN_ON(hpdev->state != hv_pcichild_ejecting);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ejection can come before or after the PCI bus has been set up, so
|
* Ejection can come before or after the PCI bus has been set up, so
|
||||||
* attempt to find it and tear down the bus state, if it exists. This
|
* attempt to find it and tear down the bus state, if it exists. This
|
||||||
@ -2438,7 +2427,6 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hpdev->state = hv_pcichild_ejecting;
|
|
||||||
get_pcichild(hpdev);
|
get_pcichild(hpdev);
|
||||||
INIT_WORK(&hpdev->wrk, hv_eject_device_work);
|
INIT_WORK(&hpdev->wrk, hv_eject_device_work);
|
||||||
get_hvpcibus(hbus);
|
get_hvpcibus(hbus);
|
||||||
|
Loading…
Reference in New Issue
Block a user