Re: [patch v4 1/7] crc32: move-to-documentation.diff

Joakim Tjernlund
2011-08-09T16:50:07Z

"George Spelvin" <linux@horizon.com> wrote on 2011/08/09 13:45:04:
>
> Here's a hopefully-improved Documentation file, which explains the slicing
> algorithm as well. As long as you have a big diff, it seems worth tweaking.
>
> You also might want to leave a pointer in lib/crc32.c to the relocated docs.
>
> (I'm just inclding the whole changed file because I assume it's easier
> to review that way; do you prefer a diff?)

Nice, reading this once again I think I found an old typo. See below

Perhaps Bob can add this addition to his patch series?

>
> === Cut here ===
...
> Or in little-endian:
> for (i = 0; i < input_bytes; i++) {
> remainder ^= next_input_byte();
> for (j = 0; j < 8; j++) {
> multiple = (remainder & 1) ? CRCPOLY : 0;
> remainder = (remainder << 1) ^ multiple;

Should not above line be:
remainder = (remainder >> 1) ^ multiple;
?

> }
> }
>
> If the input is a multiple of 32 bits, you can even XOR in a 32-bit
> word at a time and increase the inner loop count to 32.