Commit cef50c67 authored by Sam Bobroff's avatar Sam Bobroff Committed by Michael Ellerman

powerpc/eeh: Remove unused return path from eeh_pe_dev_traverse()

There are no users of the early-out return value from
eeh_pe_dev_traverse(), so remove it.
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/c648070f5b28fe8ca1880b48e64b267959ffd369.1565930772.git.sbobroff@linux.ibm.com
parent 2e255051
...@@ -260,7 +260,7 @@ static inline bool eeh_state_active(int state) ...@@ -260,7 +260,7 @@ static inline bool eeh_state_active(int state)
== (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE); == (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE);
} }
typedef void *(*eeh_edev_traverse_func)(struct eeh_dev *edev, void *flag); typedef void (*eeh_edev_traverse_func)(struct eeh_dev *edev, void *flag);
typedef void *(*eeh_pe_traverse_func)(struct eeh_pe *pe, void *flag); typedef void *(*eeh_pe_traverse_func)(struct eeh_pe *pe, void *flag);
void eeh_set_pe_aux_size(int size); void eeh_set_pe_aux_size(int size);
int eeh_phb_pe_create(struct pci_controller *phb); int eeh_phb_pe_create(struct pci_controller *phb);
...@@ -274,8 +274,8 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev); ...@@ -274,8 +274,8 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev);
void eeh_pe_update_time_stamp(struct eeh_pe *pe); void eeh_pe_update_time_stamp(struct eeh_pe *pe);
void *eeh_pe_traverse(struct eeh_pe *root, void *eeh_pe_traverse(struct eeh_pe *root,
eeh_pe_traverse_func fn, void *flag); eeh_pe_traverse_func fn, void *flag);
void *eeh_pe_dev_traverse(struct eeh_pe *root, void eeh_pe_dev_traverse(struct eeh_pe *root,
eeh_edev_traverse_func fn, void *flag); eeh_edev_traverse_func fn, void *flag);
void eeh_pe_restore_bars(struct eeh_pe *pe); void eeh_pe_restore_bars(struct eeh_pe *pe);
const char *eeh_pe_loc_get(struct eeh_pe *pe); const char *eeh_pe_loc_get(struct eeh_pe *pe);
struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe); struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe);
......
...@@ -705,7 +705,7 @@ int eeh_pci_enable(struct eeh_pe *pe, int function) ...@@ -705,7 +705,7 @@ int eeh_pci_enable(struct eeh_pe *pe, int function)
return rc; return rc;
} }
static void *eeh_disable_and_save_dev_state(struct eeh_dev *edev, static void eeh_disable_and_save_dev_state(struct eeh_dev *edev,
void *userdata) void *userdata)
{ {
struct pci_dev *pdev = eeh_dev_to_pci_dev(edev); struct pci_dev *pdev = eeh_dev_to_pci_dev(edev);
...@@ -716,7 +716,7 @@ static void *eeh_disable_and_save_dev_state(struct eeh_dev *edev, ...@@ -716,7 +716,7 @@ static void *eeh_disable_and_save_dev_state(struct eeh_dev *edev,
* state for the specified device * state for the specified device
*/ */
if (!pdev || pdev == dev) if (!pdev || pdev == dev)
return NULL; return;
/* Ensure we have D0 power state */ /* Ensure we have D0 power state */
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
...@@ -729,18 +729,16 @@ static void *eeh_disable_and_save_dev_state(struct eeh_dev *edev, ...@@ -729,18 +729,16 @@ static void *eeh_disable_and_save_dev_state(struct eeh_dev *edev,
* interrupt from the device * interrupt from the device
*/ */
pci_write_config_word(pdev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE); pci_write_config_word(pdev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE);
return NULL;
} }
static void *eeh_restore_dev_state(struct eeh_dev *edev, void *userdata) static void eeh_restore_dev_state(struct eeh_dev *edev, void *userdata)
{ {
struct pci_dn *pdn = eeh_dev_to_pdn(edev); struct pci_dn *pdn = eeh_dev_to_pdn(edev);
struct pci_dev *pdev = eeh_dev_to_pci_dev(edev); struct pci_dev *pdev = eeh_dev_to_pci_dev(edev);
struct pci_dev *dev = userdata; struct pci_dev *dev = userdata;
if (!pdev) if (!pdev)
return NULL; return;
/* Apply customization from firmware */ /* Apply customization from firmware */
if (pdn && eeh_ops->restore_config) if (pdn && eeh_ops->restore_config)
...@@ -749,8 +747,6 @@ static void *eeh_restore_dev_state(struct eeh_dev *edev, void *userdata) ...@@ -749,8 +747,6 @@ static void *eeh_restore_dev_state(struct eeh_dev *edev, void *userdata)
/* The caller should restore state for the specified device */ /* The caller should restore state for the specified device */
if (pdev != dev) if (pdev != dev)
pci_restore_state(pdev); pci_restore_state(pdev);
return NULL;
} }
int eeh_restore_vf_config(struct pci_dn *pdn) int eeh_restore_vf_config(struct pci_dn *pdn)
...@@ -876,7 +872,7 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat ...@@ -876,7 +872,7 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
* the indicated device and its children so that the bunch of the * the indicated device and its children so that the bunch of the
* devices could be reset properly. * devices could be reset properly.
*/ */
static void *eeh_set_dev_freset(struct eeh_dev *edev, void *flag) static void eeh_set_dev_freset(struct eeh_dev *edev, void *flag)
{ {
struct pci_dev *dev; struct pci_dev *dev;
unsigned int *freset = (unsigned int *)flag; unsigned int *freset = (unsigned int *)flag;
...@@ -884,8 +880,6 @@ static void *eeh_set_dev_freset(struct eeh_dev *edev, void *flag) ...@@ -884,8 +880,6 @@ static void *eeh_set_dev_freset(struct eeh_dev *edev, void *flag)
dev = eeh_dev_to_pci_dev(edev); dev = eeh_dev_to_pci_dev(edev);
if (dev) if (dev)
*freset |= dev->needs_freset; *freset |= dev->needs_freset;
return NULL;
} }
static void eeh_pe_refreeze_passed(struct eeh_pe *root) static void eeh_pe_refreeze_passed(struct eeh_pe *root)
......
...@@ -197,12 +197,12 @@ static void eeh_enable_irq(struct eeh_dev *edev) ...@@ -197,12 +197,12 @@ static void eeh_enable_irq(struct eeh_dev *edev)
} }
} }
static void *eeh_dev_save_state(struct eeh_dev *edev, void *userdata) static void eeh_dev_save_state(struct eeh_dev *edev, void *userdata)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
if (!edev) if (!edev)
return NULL; return;
/* /*
* We cannot access the config space on some adapters. * We cannot access the config space on some adapters.
...@@ -212,14 +212,13 @@ static void *eeh_dev_save_state(struct eeh_dev *edev, void *userdata) ...@@ -212,14 +212,13 @@ static void *eeh_dev_save_state(struct eeh_dev *edev, void *userdata)
* device is created. * device is created.
*/ */
if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED)) if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED))
return NULL; return;
pdev = eeh_dev_to_pci_dev(edev); pdev = eeh_dev_to_pci_dev(edev);
if (!pdev) if (!pdev)
return NULL; return;
pci_save_state(pdev); pci_save_state(pdev);
return NULL;
} }
static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s) static void eeh_set_channel_state(struct eeh_pe *root, enum pci_channel_state s)
...@@ -385,12 +384,12 @@ static enum pci_ers_result eeh_report_reset(struct eeh_dev *edev, ...@@ -385,12 +384,12 @@ static enum pci_ers_result eeh_report_reset(struct eeh_dev *edev,
return driver->err_handler->slot_reset(pdev); return driver->err_handler->slot_reset(pdev);
} }
static void *eeh_dev_restore_state(struct eeh_dev *edev, void *userdata) static void eeh_dev_restore_state(struct eeh_dev *edev, void *userdata)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
if (!edev) if (!edev)
return NULL; return;
/* /*
* The content in the config space isn't saved because * The content in the config space isn't saved because
...@@ -402,15 +401,14 @@ static void *eeh_dev_restore_state(struct eeh_dev *edev, void *userdata) ...@@ -402,15 +401,14 @@ static void *eeh_dev_restore_state(struct eeh_dev *edev, void *userdata)
if (list_is_last(&edev->entry, &edev->pe->edevs)) if (list_is_last(&edev->entry, &edev->pe->edevs))
eeh_pe_restore_bars(edev->pe); eeh_pe_restore_bars(edev->pe);
return NULL; return;
} }
pdev = eeh_dev_to_pci_dev(edev); pdev = eeh_dev_to_pci_dev(edev);
if (!pdev) if (!pdev)
return NULL; return;
pci_restore_state(pdev); pci_restore_state(pdev);
return NULL;
} }
/** /**
...@@ -491,7 +489,7 @@ static void *eeh_add_virt_device(struct eeh_dev *edev) ...@@ -491,7 +489,7 @@ static void *eeh_add_virt_device(struct eeh_dev *edev)
return NULL; return NULL;
} }
static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata) static void eeh_rmv_device(struct eeh_dev *edev, void *userdata)
{ {
struct pci_driver *driver; struct pci_driver *driver;
struct pci_dev *dev = eeh_dev_to_pci_dev(edev); struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
...@@ -506,7 +504,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata) ...@@ -506,7 +504,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
*/ */
if (!eeh_edev_actionable(edev) || if (!eeh_edev_actionable(edev) ||
(dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE))
return NULL; return;
if (rmv_data) { if (rmv_data) {
driver = eeh_pcid_get(dev); driver = eeh_pcid_get(dev);
...@@ -515,7 +513,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata) ...@@ -515,7 +513,7 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
driver->err_handler->error_detected && driver->err_handler->error_detected &&
driver->err_handler->slot_reset) { driver->err_handler->slot_reset) {
eeh_pcid_put(dev); eeh_pcid_put(dev);
return NULL; return;
} }
eeh_pcid_put(dev); eeh_pcid_put(dev);
} }
...@@ -548,8 +546,6 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata) ...@@ -548,8 +546,6 @@ static void *eeh_rmv_device(struct eeh_dev *edev, void *userdata)
pci_stop_and_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_unlock_rescan_remove(); pci_unlock_rescan_remove();
} }
return NULL;
} }
static void *eeh_pe_detach_dev(struct eeh_pe *pe, void *userdata) static void *eeh_pe_detach_dev(struct eeh_pe *pe, void *userdata)
......
...@@ -231,29 +231,22 @@ void *eeh_pe_traverse(struct eeh_pe *root, ...@@ -231,29 +231,22 @@ void *eeh_pe_traverse(struct eeh_pe *root,
* The function is used to traverse the devices of the specified * The function is used to traverse the devices of the specified
* PE and its child PEs. * PE and its child PEs.
*/ */
void *eeh_pe_dev_traverse(struct eeh_pe *root, void eeh_pe_dev_traverse(struct eeh_pe *root,
eeh_edev_traverse_func fn, void *flag) eeh_edev_traverse_func fn, void *flag)
{ {
struct eeh_pe *pe; struct eeh_pe *pe;
struct eeh_dev *edev, *tmp; struct eeh_dev *edev, *tmp;
void *ret;
if (!root) { if (!root) {
pr_warn("%s: Invalid PE %p\n", pr_warn("%s: Invalid PE %p\n",
__func__, root); __func__, root);
return NULL; return;
} }
/* Traverse root PE */ /* Traverse root PE */
eeh_for_each_pe(root, pe) { eeh_for_each_pe(root, pe)
eeh_pe_for_each_dev(pe, edev, tmp) { eeh_pe_for_each_dev(pe, edev, tmp)
ret = fn(edev, flag); fn(edev, flag);
if (ret)
return ret;
}
}
return NULL;
} }
/** /**
...@@ -602,13 +595,11 @@ void eeh_pe_mark_isolated(struct eeh_pe *root) ...@@ -602,13 +595,11 @@ void eeh_pe_mark_isolated(struct eeh_pe *root)
} }
EXPORT_SYMBOL_GPL(eeh_pe_mark_isolated); EXPORT_SYMBOL_GPL(eeh_pe_mark_isolated);
static void *__eeh_pe_dev_mode_mark(struct eeh_dev *edev, void *flag) static void __eeh_pe_dev_mode_mark(struct eeh_dev *edev, void *flag)
{ {
int mode = *((int *)flag); int mode = *((int *)flag);
edev->mode |= mode; edev->mode |= mode;
return NULL;
} }
/** /**
...@@ -827,7 +818,7 @@ static void eeh_restore_device_bars(struct eeh_dev *edev) ...@@ -827,7 +818,7 @@ static void eeh_restore_device_bars(struct eeh_dev *edev)
* the expansion ROM base address, the latency timer, and etc. * the expansion ROM base address, the latency timer, and etc.
* from the saved values in the device node. * from the saved values in the device node.
*/ */
static void *eeh_restore_one_device_bars(struct eeh_dev *edev, void *flag) static void eeh_restore_one_device_bars(struct eeh_dev *edev, void *flag)
{ {
struct pci_dn *pdn = eeh_dev_to_pdn(edev); struct pci_dn *pdn = eeh_dev_to_pdn(edev);
...@@ -839,8 +830,6 @@ static void *eeh_restore_one_device_bars(struct eeh_dev *edev, void *flag) ...@@ -839,8 +830,6 @@ static void *eeh_restore_one_device_bars(struct eeh_dev *edev, void *flag)
if (eeh_ops->restore_config && pdn) if (eeh_ops->restore_config && pdn)
eeh_ops->restore_config(pdn); eeh_ops->restore_config(pdn);
return NULL;
} }
/** /**
......
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