diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/crc32.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 7d275c4fc011..edf34e876e40 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h | |||
| @@ -29,7 +29,12 @@ extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); | |||
| 29 | * with the same initializer as crc1, and crc2 seed was 0. See | 29 | * with the same initializer as crc1, and crc2 seed was 0. See |
| 30 | * also crc32_combine_test(). | 30 | * also crc32_combine_test(). |
| 31 | */ | 31 | */ |
| 32 | extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2); | 32 | u32 __attribute_const__ crc32_le_shift(u32 crc, size_t len); |
| 33 | |||
| 34 | static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2) | ||
| 35 | { | ||
| 36 | return crc32_le_shift(crc1, len2) ^ crc2; | ||
| 37 | } | ||
| 33 | 38 | ||
| 34 | extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); | 39 | extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); |
| 35 | 40 | ||
| @@ -51,7 +56,12 @@ extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); | |||
| 51 | * seeded with the same initializer as crc1, and crc2 seed | 56 | * seeded with the same initializer as crc1, and crc2 seed |
| 52 | * was 0. See also crc32c_combine_test(). | 57 | * was 0. See also crc32c_combine_test(). |
| 53 | */ | 58 | */ |
| 54 | extern u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2); | 59 | u32 __attribute_const__ __crc32c_le_shift(u32 crc, size_t len); |
| 60 | |||
| 61 | static inline u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2) | ||
| 62 | { | ||
| 63 | return __crc32c_le_shift(crc1, len2) ^ crc2; | ||
| 64 | } | ||
| 55 | 65 | ||
| 56 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) | 66 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) |
| 57 | 67 | ||
