Commit 27d4396e authored by Sam Bobroff's avatar Sam Bobroff Committed by Michael Ellerman

powerpc/eeh: Slightly simplify eeh_add_to_parent_pe()

Simplify some needlessly complicated boolean logic in
eeh_add_to_parent_pe().
Signed-off-by: default avatarSam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/09259a50308f10aa764695912bc87dc1d1cf654c.1565930772.git.sbobroff@linux.ibm.com
parent cef50c67
...@@ -383,32 +383,34 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev) ...@@ -383,32 +383,34 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
* components. * components.
*/ */
pe = eeh_pe_get(pdn->phb, edev->pe_config_addr, config_addr); pe = eeh_pe_get(pdn->phb, edev->pe_config_addr, config_addr);
if (pe && !(pe->type & EEH_PE_INVALID)) { if (pe) {
/* Mark the PE as type of PCI bus */ if (pe->type & EEH_PE_INVALID) {
pe->type = EEH_PE_BUS; list_add_tail(&edev->entry, &pe->edevs);
edev->pe = pe; edev->pe = pe;
/*
/* Put the edev to PE */ * We're running to here because of PCI hotplug caused by
list_add_tail(&edev->entry, &pe->edevs); * EEH recovery. We need clear EEH_PE_INVALID until the top.
eeh_edev_dbg(edev, "Added to bus PE\n"); */
return 0; parent = pe;
} else if (pe && (pe->type & EEH_PE_INVALID)) { while (parent) {
list_add_tail(&edev->entry, &pe->edevs); if (!(parent->type & EEH_PE_INVALID))
edev->pe = pe; break;
/* parent->type &= ~EEH_PE_INVALID;
* We're running to here because of PCI hotplug caused by parent = parent->parent;
* EEH recovery. We need clear EEH_PE_INVALID until the top. }
*/
parent = pe;
while (parent) {
if (!(parent->type & EEH_PE_INVALID))
break;
parent->type &= ~EEH_PE_INVALID;
parent = parent->parent;
}
eeh_edev_dbg(edev, "Added to device PE (parent: PE#%x)\n", eeh_edev_dbg(edev,
pe->parent->addr); "Added to device PE (parent: PE#%x)\n",
pe->parent->addr);
} else {
/* Mark the PE as type of PCI bus */
pe->type = EEH_PE_BUS;
edev->pe = pe;
/* Put the edev to PE */
list_add_tail(&edev->entry, &pe->edevs);
eeh_edev_dbg(edev, "Added to bus PE\n");
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment