Thanks for the nitpicks!
I think you might want to cc Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
to let this go via akpm's tree for misc changes, perhaps?
I don't care, but akpm is fine by me. I'll send out a v2 after I resolve
one minor point with you; see below.
Once that's done, may I add a Reviewed-by: or Acked-by: line from you?
Looks good to me! Do you have any performance numbers to share?
Actually, I didn't bother benchmarking it because the improvement was
so obvious, but here's a quick test showing a 35.5x performance gain.
-extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2);
+u32 crc32_le_shift(u32 crc, size_t len) __attribute_const__;
Perhaps a newline here.
Question: where do you think a newline should go? It's not obvious
to me. My style has been to keep as much of a declaration on one line
as possible so "git grep <function> include" is as informative as possible.
Now that I've gotten an ack, I'm happy to be more aggressive about
tweaking comments. I just wanted to focus the diff on the code changes.
--+/**
+ * crc32_generic_shift - Append len 0 bytes to crc, in logarithmic time
+ * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
+ * @len: The number of bytes. @crc is multiplied by x^(8*@len)
+ # @polynomial: The modulus used to reduce the result to 32 bits.
^^ seems this should have been a '*'
Yes, obviously. Thanks for catching that.
+static u32 __attribute_const__ crc32_generic_shift(u32 crc, size_t len,
+ u32 polynomial)
u32 polynomial is not correctly aligned to the opening '(' from the previous line.
Thanks again.