* [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources
@ 2019-08-06 16:01 Denis Efremov
2019-08-06 18:11 ` Sebastian Ott
2019-08-06 20:48 ` Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Denis Efremov @ 2019-08-06 16:01 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Denis Efremov, Sebastian Ott, Gerald Schaefer, linux-pci,
linux-s390, linux-kernel
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.
Signed-off-by: Denis Efremov <efremov@linux.com>
---
arch/s390/pci/pci.c | 8 ++++----
1 file 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
}
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources
2019-08-06 16:01 [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources Denis Efremov
@ 2019-08-06 18:11 ` Sebastian Ott
2019-08-06 20:48 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Ott @ 2019-08-06 18:11 UTC (permalink / raw)
To: Denis Efremov
Cc: Bjorn Helgaas, Gerald Schaefer, linux-pci, linux-s390, linux-kernel
On Tue, 6 Aug 2019, Denis Efremov wrote:
> 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.
>
> Signed-off-by: Denis Efremov <efremov@linux.com>
Applied for inclusion via s390/linux.git . Thanks!
Sebastian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources
2019-08-06 16:01 [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources Denis Efremov
2019-08-06 18:11 ` Sebastian Ott
@ 2019-08-06 20:48 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2019-08-06 20:48 UTC (permalink / raw)
To: Denis Efremov
Cc: Sebastian Ott, Gerald Schaefer, linux-pci, linux-s390, linux-kernel
Thanks for the patch!
Sebastian may have silently fixed this, but for future reference,
$ git log --oneline arch/s390/pci/pci.c
c7ff0e918a7c s390/pci: deal with devices that have no support for MIO instructions
dcd33b23c9f3 s390/pci: fix assignment of bus resources
56271303808f s390/pci: add parameter to disable usage of MIO instructions
71ba41c9b1d9 s390/pci: provide support for MIO instructions
81deca12c202 s390/pci: move io address mapping code to pci_insn.c
fbfe07d440f2 s390/pci: add parameter to force floating irqs
c840927cf5f2 s390/pci: move everything irq related to pci_irq.c
066ee72aecdc s390/pci: remove unused define
...
shows that the typical style there is to start the subject with a verb
so it's an imperative sentence.
On Tue, Aug 06, 2019 at 07:01:37PM +0300, Denis Efremov wrote:
> 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.
>
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
> arch/s390/pci/pci.c | 8 ++++----
> 1 file 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
> }
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-06 20:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 16:01 [PATCH] s390/pci: PCI_IOV_RESOURCES loop refactoring in zpci_map_resources Denis Efremov
2019-08-06 18:11 ` Sebastian Ott
2019-08-06 20:48 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).