diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2016-08-17 06:03:05 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-08-21 21:09:33 -0400 |
commit | 6096481649ac27466cf2b453f185b43f680bf541 (patch) | |
tree | c7711132e4e63561e52070d6049d3d3e5283f30c /arch/powerpc/platforms/powernv/pci-ioda.c | |
parent | 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0 (diff) |
powerpc/powernv/pci: fix iterator signedness
Unsigned type is always non-negative, so the loop could not end in case
condition is never true.
The problem has been detected using semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci-ioda.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index fd9444f9fb0c..13218263e66e 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -149,7 +149,7 @@ static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no) | |||
149 | 149 | ||
150 | static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb) | 150 | static struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb) |
151 | { | 151 | { |
152 | unsigned long pe = phb->ioda.total_pe_num - 1; | 152 | long pe; |
153 | 153 | ||
154 | for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) { | 154 | for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) { |
155 | if (!test_and_set_bit(pe, phb->ioda.pe_alloc)) | 155 | if (!test_and_set_bit(pe, phb->ioda.pe_alloc)) |