net: more timeouts that reach -1
with while (timeout-- > 0); timeout reaches -1 after the loop, so the tests below are off by one. also don't do an '< 0' test on an unsigned. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4222474519
commit
858b9ced6e
@@ -957,13 +957,14 @@ jme_process_receive(struct jme_adapter *jme, int limit)
|
||||
goto out_inc;
|
||||
|
||||
i = atomic_read(&rxring->next_to_clean);
|
||||
while (limit-- > 0) {
|
||||
while (limit > 0) {
|
||||
rxdesc = rxring->desc;
|
||||
rxdesc += i;
|
||||
|
||||
if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) ||
|
||||
!(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL))
|
||||
goto out;
|
||||
--limit;
|
||||
|
||||
desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;
|
||||
|
||||
|
Reference in New Issue
Block a user