| .. | .. |
|---|
| 24 | 24 | * Version 2. See the file COPYING for more details. |
|---|
| 25 | 25 | */ |
|---|
| 26 | 26 | |
|---|
| 27 | | -/* see: Documentation/crc32.txt for a description of algorithms */ |
|---|
| 27 | +/* see: Documentation/staging/crc32.rst for a description of algorithms */ |
|---|
| 28 | 28 | |
|---|
| 29 | 29 | #include <linux/crc32.h> |
|---|
| 30 | 30 | #include <linux/crc32poly.h> |
|---|
| .. | .. |
|---|
| 183 | 183 | } |
|---|
| 184 | 184 | |
|---|
| 185 | 185 | #if CRC_LE_BITS == 1 |
|---|
| 186 | | -u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 186 | +u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 187 | 187 | { |
|---|
| 188 | 188 | return crc32_le_generic(crc, p, len, NULL, CRC32_POLY_LE); |
|---|
| 189 | 189 | } |
|---|
| 190 | | -u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 190 | +u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 191 | 191 | { |
|---|
| 192 | 192 | return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE); |
|---|
| 193 | 193 | } |
|---|
| 194 | 194 | #else |
|---|
| 195 | | -u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 195 | +u32 __pure __weak crc32_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 196 | 196 | { |
|---|
| 197 | 197 | return crc32_le_generic(crc, p, len, |
|---|
| 198 | 198 | (const u32 (*)[256])crc32table_le, CRC32_POLY_LE); |
|---|
| 199 | 199 | } |
|---|
| 200 | | -u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 200 | +u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len) |
|---|
| 201 | 201 | { |
|---|
| 202 | 202 | return crc32_le_generic(crc, p, len, |
|---|
| 203 | 203 | (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE); |
|---|
| .. | .. |
|---|
| 206 | 206 | EXPORT_SYMBOL(crc32_le); |
|---|
| 207 | 207 | EXPORT_SYMBOL(__crc32c_le); |
|---|
| 208 | 208 | |
|---|
| 209 | +u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le); |
|---|
| 210 | +u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le); |
|---|
| 211 | + |
|---|
| 209 | 212 | /* |
|---|
| 210 | 213 | * This multiplies the polynomials x and y modulo the given modulus. |
|---|
| 211 | 214 | * This follows the "little-endian" CRC convention that the lsbit |
|---|