PCI: Index IOV resources in the conventional style
Most of PCI uses "res = &dev->resource[i]", not "res = dev->resource + i". Use that style in iov.c also. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Wei Yang <weiyang@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
0e6c9122a6
commit
c1fe1f96e3
|
@ -95,7 +95,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
|
||||||
virtfn->multifunction = 0;
|
virtfn->multifunction = 0;
|
||||||
|
|
||||||
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
||||||
res = dev->resource + PCI_IOV_RESOURCES + i;
|
res = &dev->resource[i + PCI_IOV_RESOURCES];
|
||||||
if (!res->parent)
|
if (!res->parent)
|
||||||
continue;
|
continue;
|
||||||
virtfn->resource[i].name = pci_name(virtfn);
|
virtfn->resource[i].name = pci_name(virtfn);
|
||||||
|
@ -212,7 +212,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
|
||||||
nres = 0;
|
nres = 0;
|
||||||
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
||||||
bars |= (1 << (i + PCI_IOV_RESOURCES));
|
bars |= (1 << (i + PCI_IOV_RESOURCES));
|
||||||
res = dev->resource + PCI_IOV_RESOURCES + i;
|
res = &dev->resource[i + PCI_IOV_RESOURCES];
|
||||||
if (res->parent)
|
if (res->parent)
|
||||||
nres++;
|
nres++;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
|
||||||
|
|
||||||
nres = 0;
|
nres = 0;
|
||||||
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
||||||
res = dev->resource + PCI_IOV_RESOURCES + i;
|
res = &dev->resource[i + PCI_IOV_RESOURCES];
|
||||||
bar64 = __pci_read_base(dev, pci_bar_unknown, res,
|
bar64 = __pci_read_base(dev, pci_bar_unknown, res,
|
||||||
pos + PCI_SRIOV_BAR + i * 4);
|
pos + PCI_SRIOV_BAR + i * 4);
|
||||||
if (!res->flags)
|
if (!res->flags)
|
||||||
|
@ -417,7 +417,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
||||||
res = dev->resource + PCI_IOV_RESOURCES + i;
|
res = &dev->resource[i + PCI_IOV_RESOURCES];
|
||||||
res->flags = 0;
|
res->flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue