]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: altera: Fix loop in tlp_read_packet()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Dec 2015 22:21:08 +0000 (16:21 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 4 Dec 2015 22:21:08 +0000 (16:21 -0600)
commite82fe59ed62bc0fbd75f04d19464fca05b9be840
treee00588408eae2d9749a0d1cf374170f60f949ef8
parent3b00d24e6f31e894b8bb272bbfba8abd51a8e391
PCI: altera: Fix loop in tlp_read_packet()

TLP_LOOP is 500 and the "loop" variable was a u8 so "loop < TLP_LOOP" is
always true.  We only need this condition to work if there is a problem so
it would have been easy to miss this in testing.

Make it a normal for loop with "int i" instead of over thinking things and
making it complicated.

Fixes: 6bb4dd154ae8 ("PCI: altera: Add Altera PCIe host controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Ley Foon Tan <lftan@altera.com>
drivers/pci/host/pcie-altera.c