]> git.ipfire.org Git - people/ms/linux.git/blobdiff - drivers/pci/host/pcie-altera.c
PCI: altera: Fix loop in tlp_read_packet()
[people/ms/linux.git] / drivers / pci / host / pcie-altera.c
index e5dda38bdde5e1735a50b4de9fcd2cd6307d13c5..f0820d3fadf682ca223e6b9780b27fea0d21ff4f 100644 (file)
@@ -166,7 +166,7 @@ static bool altera_pcie_valid_config(struct altera_pcie *pcie,
 
 static int tlp_read_packet(struct altera_pcie *pcie, u32 *value)
 {
-       u8 loop;
+       int i;
        bool sop = 0;
        u32 ctrl;
        u32 reg0, reg1;
@@ -175,7 +175,7 @@ static int tlp_read_packet(struct altera_pcie *pcie, u32 *value)
         * Minimum 2 loops to read TLP headers and 1 loop to read data
         * payload.
         */
-       for (loop = 0; loop < TLP_LOOP; loop++) {
+       for (i = 0; i < TLP_LOOP; i++) {
                ctrl = cra_readl(pcie, RP_RXCPL_STATUS);
                if ((ctrl & RP_RXCPL_SOP) || (ctrl & RP_RXCPL_EOP) || sop) {
                        reg0 = cra_readl(pcie, RP_RXCPL_REG0);