Skip to content

Commit c64e657

Browse files
committed
lib/crc32: rename __crc32c_le_combine() to crc32c_combine()
Since the Castagnoli CRC32 is now always just crc32c(), rename __crc32c_le_combine() and __crc32c_le_shift() accordingly. Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 8df3682 commit c64e657

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

drivers/infiniband/sw/siw/siw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ static inline __wsum siw_csum_update(const void *buff, int len, __wsum sum)
676676
static inline __wsum siw_csum_combine(__wsum csum, __wsum csum2, int offset,
677677
int len)
678678
{
679-
return (__force __wsum)__crc32c_le_combine((__force __u32)csum,
680-
(__force __u32)csum2, len);
679+
return (__force __wsum)crc32c_combine((__force __u32)csum,
680+
(__force __u32)csum2, len);
681681
}
682682

683683
static inline void siw_crc_skb(struct siw_rx_stream *srx, unsigned int len)

include/linux/crc32.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,27 @@ static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2)
7676
return crc32_le_shift(crc1, len2) ^ crc2;
7777
}
7878

79+
u32 crc32c_shift(u32 crc, size_t len);
80+
7981
/**
80-
* __crc32c_le_combine - Combine two crc32c check values into one. For two
81-
* sequences of bytes, seq1 and seq2 with lengths len1
82-
* and len2, __crc32c_le() check values were calculated
83-
* for each, crc1 and crc2.
82+
* crc32c_combine - Combine two crc32c check values into one. For two sequences
83+
* of bytes, seq1 and seq2 with lengths len1 and len2, crc32c()
84+
* check values were calculated for each, crc1 and crc2.
8485
*
8586
* @crc1: crc32c of the first block
8687
* @crc2: crc32c of the second block
8788
* @len2: length of the second block
8889
*
89-
* Return: The __crc32c_le() check value of seq1 and seq2 concatenated,
90-
* requiring only crc1, crc2, and len2. Note: If seq_full denotes
91-
* the concatenated memory area of seq1 with seq2, and crc_full
92-
* the __crc32c_le() value of seq_full, then crc_full ==
93-
* __crc32c_le_combine(crc1, crc2, len2) when crc_full was
94-
* seeded with the same initializer as crc1, and crc2 seed
95-
* was 0. See also crc32c_combine_test().
90+
* Return: The crc32c() check value of seq1 and seq2 concatenated, requiring
91+
* only crc1, crc2, and len2. Note: If seq_full denotes the concatenated
92+
* memory area of seq1 with seq2, and crc_full the crc32c() value of
93+
* seq_full, then crc_full == crc32c_combine(crc1, crc2, len2) when
94+
* crc_full was seeded with the same initializer as crc1, and crc2 seed
95+
* was 0. See also crc_combine_test().
9696
*/
97-
u32 __crc32c_le_shift(u32 crc, size_t len);
98-
99-
static inline u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2)
97+
static inline u32 crc32c_combine(u32 crc1, u32 crc2, size_t len2)
10098
{
101-
return __crc32c_le_shift(crc1, len2) ^ crc2;
99+
return crc32c_shift(crc1, len2) ^ crc2;
102100
}
103101

104102
#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length)

include/net/sctp/checksum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ static inline __wsum sctp_csum_update(const void *buff, int len, __wsum sum)
3636
static inline __wsum sctp_csum_combine(__wsum csum, __wsum csum2,
3737
int offset, int len)
3838
{
39-
return (__force __wsum)__crc32c_le_combine((__force __u32)csum,
40-
(__force __u32)csum2, len);
39+
return (__force __wsum)crc32c_combine((__force __u32)csum,
40+
(__force __u32)csum2, len);
4141
}
4242

4343
static const struct skb_checksum_ops sctp_csum_ops = {

lib/crc32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ u32 crc32_le_shift(u32 crc, size_t len)
117117
{
118118
return crc32_generic_shift(crc, len, CRC32_POLY_LE);
119119
}
120+
EXPORT_SYMBOL(crc32_le_shift);
120121

121-
u32 __crc32c_le_shift(u32 crc, size_t len)
122+
u32 crc32c_shift(u32 crc, size_t len)
122123
{
123124
return crc32_generic_shift(crc, len, CRC32C_POLY_LE);
124125
}
125-
EXPORT_SYMBOL(crc32_le_shift);
126-
EXPORT_SYMBOL(__crc32c_le_shift);
126+
EXPORT_SYMBOL(crc32c_shift);
127127

128128
u32 crc32_be_base(u32 crc, const u8 *p, size_t len)
129129
{

lib/crc_kunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static u64 crc32c_wrapper(u64 crc, const u8 *p, size_t len)
363363

364364
static u64 crc32c_combine_wrapper(u64 crc1, u64 crc2, size_t len2)
365365
{
366-
return __crc32c_le_combine(crc1, crc2, len2);
366+
return crc32c_combine(crc1, crc2, len2);
367367
}
368368

369369
static const struct crc_variant crc_variant_crc32c = {

0 commit comments

Comments
 (0)