Lines Matching +full:p +full:- +full:256
3 * cleaned up code to current version of sparse and added the slicing-by-8
4 * algorithm to the closely similar existing slicing-by-4 algorithm.
9 * subsequently included in the kernel, thus was re-licensed under the
56 /* implements slicing-by-4 or slicing-by-8 algorithm */
58 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
88 } while ((--len) && ((long)buf)&3);
101 --b;
104 for (--b; len; --len) {
118 u8 *p = (u8 *)(b + 1) - 1; local
121 DO_CRC(*++p); /* use pre increment for speed */
124 DO_CRC(*++p); /* use pre increment for speed */
125 } while (--len);
137 * crc32_le_generic() - Calculate bitwise little-endian Ethernet AUTODIN II
141 * @p: pointer to buffer over which CRC32/CRC32C is run
142 * @len: length of buffer @p
143 * @tab: little-endian Ethernet table
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
147 size_t len, const u32 (*tab)[256], argument
152 while (len--) {
153 crc ^= *p++;
158 while (len--) {
159 crc ^= *p++;
166 while (len--) {
167 crc ^= *p++;
173 while (len--) {
174 crc ^= *p++;
179 crc = crc32_body(crc, p, len, tab);
186 u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len) argument
188 return crc32_le_generic(crc, p, len, NULL, CRC32_POLY_LE);
190 u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len) argument
192 return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE);
195 u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len) argument
197 return crc32_le_generic(crc, p, len,
198 (const u32 (*)[256])crc32table_le, CRC32_POLY_LE);
200 u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len) argument
202 return crc32_le_generic(crc, p, len,
203 (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE);
214 * This follows the "little-endian" CRC convention that the lsbit
232 * crc32_generic_shift - Append @len 0 bytes to crc, in logarithmic time
233 * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
286 * crc32_be_generic() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32
289 * @p: pointer to buffer over which CRC32 is run
290 * @len: length of buffer @p
291 * @tab: big-endian Ethernet table
294 static inline u32 __pure crc32_be_generic(u32 crc, unsigned char const *p, argument
295 size_t len, const u32 (*tab)[256], argument
300 while (len--) {
301 crc ^= *p++ << 24;
308 while (len--) {
309 crc ^= *p++ << 24;
316 while (len--) {
317 crc ^= *p++ << 24;
322 while (len--) {
323 crc ^= *p++ << 24;
328 crc = crc32_body(crc, p, len, tab);
335 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len) argument
337 return crc32_be_generic(crc, p, len, NULL, CRC32_POLY_BE);
340 u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len) argument
342 return crc32_be_generic(crc, p, len,
343 (const u32 (*)[256])crc32table_be, CRC32_POLY_BE);