aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/crc32.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/crc32.c b/lib/crc32.c
index 072fbd8234d5..410093dbe51c 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -131,11 +131,14 @@ crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256])
131#endif 131#endif
132 132
133/** 133/**
134 * crc32_le() - Calculate bitwise little-endian Ethernet AUTODIN II CRC32 134 * crc32_le_generic() - Calculate bitwise little-endian Ethernet AUTODIN II
135 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for 135 * CRC32/CRC32C
136 * other uses, or the previous crc32 value if computing incrementally. 136 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for other
137 * @p: pointer to buffer over which CRC is run 137 * uses, or the previous crc32/crc32c value if computing incrementally.
138 * @p: pointer to buffer over which CRC32/CRC32C is run
138 * @len: length of buffer @p 139 * @len: length of buffer @p
140 * @tab: little-endian Ethernet table
141 * @polynomial: CRC32/CRC32c LE polynomial
139 */ 142 */
140static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, 143static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p,
141 size_t len, const u32 (*tab)[256], 144 size_t len, const u32 (*tab)[256],
@@ -201,11 +204,13 @@ EXPORT_SYMBOL(crc32_le);
201EXPORT_SYMBOL(__crc32c_le); 204EXPORT_SYMBOL(__crc32c_le);
202 205
203/** 206/**
204 * crc32_be() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 207 * crc32_be_generic() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32
205 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for 208 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for
206 * other uses, or the previous crc32 value if computing incrementally. 209 * other uses, or the previous crc32 value if computing incrementally.
207 * @p: pointer to buffer over which CRC is run 210 * @p: pointer to buffer over which CRC32 is run
208 * @len: length of buffer @p 211 * @len: length of buffer @p
212 * @tab: big-endian Ethernet table
213 * @polynomial: CRC32 BE polynomial
209 */ 214 */
210static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p, 215static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p,
211 size_t len, const u32 (*tab)[256], 216 size_t len, const u32 (*tab)[256],