Commit 4f438157 authored by Volker Lendecke's avatar Volker Lendecke Committed by Rusty Russell

tally: Adapt bucket_of to Samba coding conventions

(Imported from SAMBA commit 68d0843437b05dc8a36091e4a307bfd912cbc09f)
parent 237fc67d
......@@ -52,8 +52,9 @@ struct tally *tally_new(unsigned buckets)
static unsigned bucket_of(ssize_t min, unsigned step_bits, ssize_t val)
{
/* Don't over-shift. */
if (step_bits == SIZET_BITS)
if (step_bits == SIZET_BITS) {
return 0;
}
assert(step_bits < SIZET_BITS);
return (size_t)(val - min) >> step_bits;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment