summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2019-08-06 19:01:37 +0300
committerVasily Gorbik <gor@linux.ibm.com>2019-08-21 12:41:43 +0200
commitc4c3772384bc93e3d1eccd88bd7f5d74de74e0d7 (patch)
tree8b8eb6e7651905dd0f21f5fd44e2cd69aad7d814 /arch/s390/pci
parent59793c5ab93fed9661deaf6d8ba054af681c0a6a (diff)
downloadlinux-c4c3772384bc93e3d1eccd88bd7f5d74de74e0d7.tar.bz2
s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources
This patch alters the for loop iteration scheme in zpci_map_resources to make it more usual. Thus, the patch generalizes the style for PCI_IOV_RESOURCES iteration and improves readability. Link: http://lkml.kernel.org/r/20190806160137.29275-1-efremov@linux.com Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Sebastian Ott <sebott@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index b0e3b9a0e488..c7fea9bea8cb 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -431,13 +431,13 @@ static void zpci_map_resources(struct pci_dev *pdev)
}
#ifdef CONFIG_PCI_IOV
- i = PCI_IOV_RESOURCES;
+ for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
+ int bar = i + PCI_IOV_RESOURCES;
- for (; i < PCI_SRIOV_NUM_BARS + PCI_IOV_RESOURCES; i++) {
- len = pci_resource_len(pdev, i);
+ len = pci_resource_len(pdev, bar);
if (!len)
continue;
- pdev->resource[i].parent = &iov_res;
+ pdev->resource[bar].parent = &iov_res;
}
#endif
}