summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-12-09 22:11:25 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:36:52 (GMT)
commitce2f9cb83a82976f1bd9560daefdaf7fa7ac5ac2 (patch)
tree9c61d5483879795ff99b220baf5d68f1ebd85e69 /drivers/pci
parent6479766c9ebb900ff045e8577ad0493dcb87d27c (diff)
downloadlinux-fsl-qoriq-ce2f9cb83a82976f1bd9560daefdaf7fa7ac5ac2.tar.xz
PCI: designware: Use typical "for" loop idiom
It's conventional to use "for" rather than "while" for simple iteration. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> The patch comes from: https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?id=0b8cfb6aa3aabc96177b1e68ef13d2eb5c686606 Change-Id: Idc9f17b671cd3798ea8976f61a4574f556e93141 Reviewed-on: http://git.am.freescale.net:8181/19685 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pcie-designware.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index c1e0bfd..268e986 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -214,8 +214,7 @@ static void clear_irq_range(struct pcie_port *pp, unsigned int irq_base,
{
unsigned int i, res, bit, val;
- i = 0;
- while (i < nvec) {
+ for (i = 0; i < nvec; i++) {
irq_set_msi_desc_off(irq_base, i, NULL);
clear_bit(pos + i, pp->msi_irq_in_use);
/* Disable corresponding interrupt on MSI controller */
@@ -224,7 +223,6 @@ static void clear_irq_range(struct pcie_port *pp, unsigned int irq_base,
dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, &val);
val &= ~(1 << bit);
dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, val);
- ++i;
}
}
@@ -268,8 +266,7 @@ static int assign_irq(int no_irqs, struct msi_desc *desc, int *pos)
* descs are also successfully allocated.
*/
- i = 0;
- while (i < no_irqs) {
+ for (i = 0; i < no_irqs; i++) {
if (irq_set_msi_desc_off(irq, i, desc) != 0) {
clear_irq_range(pp, irq, i, pos0);
goto no_valid_irq;
@@ -281,7 +278,6 @@ static int assign_irq(int no_irqs, struct msi_desc *desc, int *pos)
dw_pcie_rd_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, &val);
val |= 1 << bit;
dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + res, 4, val);
- i++;
}
*pos = pos0;