diff options
Diffstat (limited to 'lib/crc32.c')
| -rw-r--r-- | lib/crc32.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/crc32.c b/lib/crc32.c index a6c9afafc8c8..45b1d67a1767 100644 --- a/lib/crc32.c +++ b/lib/crc32.c | |||
| @@ -183,21 +183,21 @@ static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, | |||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | #if CRC_LE_BITS == 1 | 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 | return crc32_le_generic(crc, p, len, NULL, CRC32_POLY_LE); | 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 | return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE); | 192 | return crc32_le_generic(crc, p, len, NULL, CRC32C_POLY_LE); |
| 193 | } | 193 | } |
| 194 | #else | 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 | return crc32_le_generic(crc, p, len, | 197 | return crc32_le_generic(crc, p, len, |
| 198 | (const u32 (*)[256])crc32table_le, CRC32_POLY_LE); | 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 | return crc32_le_generic(crc, p, len, | 202 | return crc32_le_generic(crc, p, len, |
| 203 | (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE); | 203 | (const u32 (*)[256])crc32ctable_le, CRC32C_POLY_LE); |
| @@ -206,6 +206,9 @@ u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len) | |||
| 206 | EXPORT_SYMBOL(crc32_le); | 206 | EXPORT_SYMBOL(crc32_le); |
| 207 | EXPORT_SYMBOL(__crc32c_le); | 207 | EXPORT_SYMBOL(__crc32c_le); |
| 208 | 208 | ||
| 209 | u32 crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le); | ||
| 210 | u32 __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le); | ||
| 211 | |||
| 209 | /* | 212 | /* |
| 210 | * This multiplies the polynomials x and y modulo the given modulus. | 213 | * This multiplies the polynomials x and y modulo the given modulus. |
| 211 | * This follows the "little-endian" CRC convention that the lsbit | 214 | * This follows the "little-endian" CRC convention that the lsbit |
