[PATCH] powerpc: minor cleanup of void ptr deref
Minor: use macro to perform void pointer deref; this may someday help avoid pointer typecasting errors. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
398f68580f
commit
e07102db63
|
@ -326,7 +326,7 @@ static int u3_ht_skip_device(struct pci_controller *hose,
|
||||||
else
|
else
|
||||||
busdn = hose->arch_data;
|
busdn = hose->arch_data;
|
||||||
for (dn = busdn->child; dn; dn = dn->sibling)
|
for (dn = busdn->child; dn; dn = dn->sibling)
|
||||||
if (dn->data && PCI_DN(dn)->devfn == devfn)
|
if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn)
|
||||||
break;
|
break;
|
||||||
if (dn == NULL)
|
if (dn == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -436,7 +436,7 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppci = pdn->data;
|
ppci = PCI_DN(pdn);
|
||||||
if (!ppci->iommu_table) {
|
if (!ppci->iommu_table) {
|
||||||
/* Bussubno hasn't been copied yet.
|
/* Bussubno hasn't been copied yet.
|
||||||
* Do it now because iommu_table_setparms_lpar needs it.
|
* Do it now because iommu_table_setparms_lpar needs it.
|
||||||
|
@ -483,10 +483,10 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev)
|
||||||
* an already allocated iommu table is found and use that.
|
* an already allocated iommu table is found and use that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
|
while (dn && PCI_DN(dn) && PCI_DN(dn)->iommu_table == NULL)
|
||||||
dn = dn->parent;
|
dn = dn->parent;
|
||||||
|
|
||||||
if (dn && dn->data) {
|
if (dn && PCI_DN(dn)) {
|
||||||
PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
|
PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
|
||||||
} else {
|
} else {
|
||||||
DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, pci_name(dev));
|
DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, pci_name(dev));
|
||||||
|
@ -497,7 +497,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
|
||||||
{
|
{
|
||||||
int err = NOTIFY_OK;
|
int err = NOTIFY_OK;
|
||||||
struct device_node *np = node;
|
struct device_node *np = node;
|
||||||
struct pci_dn *pci = np->data;
|
struct pci_dn *pci = PCI_DN(np);
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case PSERIES_RECONFIG_REMOVE:
|
case PSERIES_RECONFIG_REMOVE:
|
||||||
|
@ -533,7 +533,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
|
||||||
*/
|
*/
|
||||||
dn = pci_device_to_OF_node(dev);
|
dn = pci_device_to_OF_node(dev);
|
||||||
|
|
||||||
for (pdn = dn; pdn && pdn->data && !PCI_DN(pdn)->iommu_table;
|
for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
|
||||||
pdn = pdn->parent) {
|
pdn = pdn->parent) {
|
||||||
dma_window = (unsigned int *)
|
dma_window = (unsigned int *)
|
||||||
get_property(pdn, "ibm,dma-window", NULL);
|
get_property(pdn, "ibm,dma-window", NULL);
|
||||||
|
@ -552,7 +552,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
|
||||||
DBG("Found DMA window, allocating table\n");
|
DBG("Found DMA window, allocating table\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pci = pdn->data;
|
pci = PCI_DN(pdn);
|
||||||
if (!pci->iommu_table) {
|
if (!pci->iommu_table) {
|
||||||
/* iommu_table_setparms_lpar needs bussubno. */
|
/* iommu_table_setparms_lpar needs bussubno. */
|
||||||
pci->bussubno = pci->phb->bus->number;
|
pci->bussubno = pci->phb->bus->number;
|
||||||
|
|
Loading…
Reference in New Issue