Commit 4fad4943 authored by Gavin Shan's avatar Gavin Shan Committed by Michael Ellerman

powerpc/powernv: Simplify pnv_eeh_reset()

This drops unnecessary nested if statements in pnv_eeh_reset() to
improve the code readability. After the changes, the unused local
variable "ret" is dropped as well. No logical changes introduced.
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 4a5954ed
...@@ -1009,8 +1009,9 @@ static int pnv_eeh_reset_vf_pe(struct eeh_pe *pe, int option) ...@@ -1009,8 +1009,9 @@ static int pnv_eeh_reset_vf_pe(struct eeh_pe *pe, int option)
static int pnv_eeh_reset(struct eeh_pe *pe, int option) static int pnv_eeh_reset(struct eeh_pe *pe, int option)
{ {
struct pci_controller *hose = pe->phb; struct pci_controller *hose = pe->phb;
struct pnv_phb *phb;
struct pci_bus *bus; struct pci_bus *bus;
int ret; int64_t rc;
/* /*
* For PHB reset, we always have complete reset. For those PEs whose * For PHB reset, we always have complete reset. For those PEs whose
...@@ -1026,11 +1027,8 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option) ...@@ -1026,11 +1027,8 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option)
* reset. The side effect is that EEH core has to clear the frozen * reset. The side effect is that EEH core has to clear the frozen
* state explicitly after BAR restore. * state explicitly after BAR restore.
*/ */
if (pe->type & EEH_PE_PHB) { if (pe->type & EEH_PE_PHB)
ret = pnv_eeh_phb_reset(hose, option); return pnv_eeh_phb_reset(hose, option);
} else {
struct pnv_phb *phb;
s64 rc;
/* /*
* The frozen PE might be caused by PAPR error injection * The frozen PE might be caused by PAPR error injection
...@@ -1047,8 +1045,7 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option) ...@@ -1047,8 +1045,7 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option)
OPAL_RESET_PHB_ERROR, OPAL_RESET_PHB_ERROR,
OPAL_ASSERT_RESET); OPAL_ASSERT_RESET);
if (rc != OPAL_SUCCESS) { if (rc != OPAL_SUCCESS) {
pr_warn("%s: Failure %lld clearing " pr_warn("%s: Failure %lld clearing error injection registers\n",
"error injection registers\n",
__func__, rc); __func__, rc);
return -EIO; return -EIO;
} }
...@@ -1056,15 +1053,13 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option) ...@@ -1056,15 +1053,13 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option)
bus = eeh_pe_bus_get(pe); bus = eeh_pe_bus_get(pe);
if (pe->type & EEH_PE_VF) if (pe->type & EEH_PE_VF)
ret = pnv_eeh_reset_vf_pe(pe, option); return pnv_eeh_reset_vf_pe(pe, option);
else if (pci_is_root_bus(bus) ||
if (pci_is_root_bus(bus) ||
pci_is_root_bus(bus->parent)) pci_is_root_bus(bus->parent))
ret = pnv_eeh_root_reset(hose, option); return pnv_eeh_root_reset(hose, option);
else
ret = pnv_eeh_bridge_reset(bus->self, option);
}
return ret; return pnv_eeh_bridge_reset(bus->self, option);
} }
/** /**
......
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