Skip to content

Commit add9195

Browse files
dcuiliuw
authored andcommitted
PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev
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 <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Acked-by: Lorenzo Pieralisi <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]>
1 parent 2738d5a commit add9195

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/pci/controller/pci-hyperv.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -545,19 +545,10 @@ struct hv_dr_state {
545545
struct hv_pcidev_description func[];
546546
};
547547

548-
enum hv_pcichild_state {
549-
hv_pcichild_init = 0,
550-
hv_pcichild_requirements,
551-
hv_pcichild_resourced,
552-
hv_pcichild_ejecting,
553-
hv_pcichild_maximum
554-
};
555-
556548
struct hv_pci_dev {
557549
/* List protected by pci_rescan_remove_lock */
558550
struct list_head list_entry;
559551
refcount_t refs;
560-
enum hv_pcichild_state state;
561552
struct pci_slot *pci_slot;
562553
struct hv_pcidev_description desc;
563554
bool reported_missing;
@@ -2843,8 +2834,6 @@ static void hv_eject_device_work(struct work_struct *work)
28432834
hpdev = container_of(work, struct hv_pci_dev, wrk);
28442835
hbus = hpdev->hbus;
28452836

2846-
WARN_ON(hpdev->state != hv_pcichild_ejecting);
2847-
28482837
/*
28492838
* Ejection can come before or after the PCI bus has been set up, so
28502839
* attempt to find it and tear down the bus state, if it exists. This
@@ -2901,7 +2890,6 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev)
29012890
return;
29022891
}
29032892

2904-
hpdev->state = hv_pcichild_ejecting;
29052893
get_pcichild(hpdev);
29062894
INIT_WORK(&hpdev->wrk, hv_eject_device_work);
29072895
queue_work(hbus->wq, &hpdev->wrk);

0 commit comments

Comments
 (0)