On ven., 2016-02-26 at 12:03 -0800, Tom Herbert wrote:
> +
> + /*
> + * Length is greater than 64. Sum to eight byte alignment before
> + * proceeding with main loop.
> + */
> + aligned = !!((unsigned long)buff & 0x1);
> + if (aligned) {
> + unsigned int align = 7 & -(unsigned long)buff;
> +
> + result = csum_partial_lt8_head(*(unsigned long *)buff, align);
> + buff += align;
> + len -= align;
> + result = rotate_by8_if_odd(result, align);
> + }
> +
This looks like you wanted to test 3 low order bits, not only the 1 low
order.
aligned = !((unsigned long)buff & 0x7);
if (!aligned) {
...
}
Or rename the variable to notaligned