Found by Coverity (attempt to fix, unsure it will convince Coverity of
the holiness of our code):
2. overflow: Subtract operation overflows on operands align and 1UL.
CID
1376162 (#1 of 1): Overflowed return value (INTEGER_OVERFLOW)3.
overflow_sink: Overflowed or truncated value (or a value computed from
an overflowed or truncated value) align != 0UL && !(align & align - 1UL)
used as return value.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
static
int is_align_valid(uint64_t align)
{
- return (align != 0) && !(align & (align - 1));
+ return (align != 0) && !(align & (align - 1ULL));
}
static