X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fcrc32.c;fp=lib%2Fcrc32.c;h=065198f98b3f5fc3aebb16ed8b9b81749ec8f741;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=285fd9bc61be1b089441663b587f34ff409fb1ba;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/lib/crc32.c b/lib/crc32.c index 285fd9bc6..065198f98 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -42,21 +42,20 @@ MODULE_AUTHOR("Matt Domsch "); MODULE_DESCRIPTION("Ethernet CRC32 calculations"); MODULE_LICENSE("GPL"); -/** - * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 - * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for - * other uses, or the previous crc32 value if computing incrementally. - * @p: pointer to buffer over which CRC is run - * @len: length of buffer @p - */ -u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len); - #if CRC_LE_BITS == 1 /* * In fact, the table-based code will work in this case, but it can be * simplified by inlining the table in ?: form. */ +/** + * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 + * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p - pointer to buffer over which CRC is run + * @len - length of buffer @p + * + */ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) { int i; @@ -69,6 +68,14 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) } #else /* Table-based approach */ +/** + * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 + * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p - pointer to buffer over which CRC is run + * @len - length of buffer @p + * + */ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) { # if CRC_LE_BITS == 8 @@ -138,21 +145,20 @@ u32 __attribute_pure__ crc32_le(u32 crc, unsigned char const *p, size_t len) } #endif -/** - * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 - * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for - * other uses, or the previous crc32 value if computing incrementally. - * @p: pointer to buffer over which CRC is run - * @len: length of buffer @p - */ -u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len); - #if CRC_BE_BITS == 1 /* * In fact, the table-based code will work in this case, but it can be * simplified by inlining the table in ?: form. */ +/** + * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 + * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p - pointer to buffer over which CRC is run + * @len - length of buffer @p + * + */ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) { int i; @@ -167,6 +173,14 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) } #else /* Table-based approach */ +/** + * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 + * @crc - seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p - pointer to buffer over which CRC is run + * @len - length of buffer @p + * + */ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) { # if CRC_BE_BITS == 8 @@ -235,10 +249,6 @@ u32 __attribute_pure__ crc32_be(u32 crc, unsigned char const *p, size_t len) } #endif -/** - * bitreverse - reverse the order of bits in a u32 value - * @x: value to be bit-reversed - */ u32 bitreverse(u32 x) { x = (x >> 16) | (x << 16);