X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftally%2Ftally.c;h=d9f30ba12f39cc87c94d2e0e12c4af23177b8add;hb=4a4985d51c2272569534457388d6178072f36452;hp=a6d66b6688dc5d6940bfc75596e20d866a098ebd;hpb=137c60bf9e4aa3160fbd44b99e54bcb0df5d6cbf;p=ccan diff --git a/ccan/tally/tally.c b/ccan/tally/tally.c index a6d66b66..d9f30ba1 100644 --- a/ccan/tally/tally.c +++ b/ccan/tally/tally.c @@ -231,8 +231,9 @@ static uint64_t divlu64(uint64_t u1, uint64_t u0, uint64_t v) uint64_t p; /* Product of two digits. */ int64_t s, i, j, t, k; - if (u1 >= v) /* If overflow, return the largest */ + if (u1 >= v) { /* If overflow, return the largest */ return (uint64_t)-1; /* possible quotient. */ + } s = 64 - fls64(v); /* 0 <= s <= 63. */ vn0 = v << s; /* Normalize divisor. */ @@ -255,7 +256,9 @@ static uint64_t divlu64(uint64_t u1, uint64_t u0, uint64_t v) if (qhat >= b || qhat*vn[0] > b*rhat + un[j]) { qhat = qhat - 1; rhat = rhat + vn[1]; - if (rhat < b) goto again; + if (rhat < b) { + goto again; + } } /* Multiply and subtract. */