Skip to content

Commit

Permalink
crypto: crc32-generic - remove __crc32_le()
Browse files Browse the repository at this point in the history
The __crc32_le() wrapper function is pointless.  Just call crc32_le()
directly instead.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed May 26, 2018
1 parent 7bcfb13 commit 6943546
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions crypto/crc32_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
#define CHKSUM_BLOCK_SIZE 1
#define CHKSUM_DIGEST_SIZE 4

static u32 __crc32_le(u32 crc, unsigned char const *p, size_t len)
{
return crc32_le(crc, p, len);
}

/** No default init with ~0 */
static int crc32_cra_init(struct crypto_tfm *tfm)
{
Expand All @@ -55,7 +50,6 @@ static int crc32_cra_init(struct crypto_tfm *tfm)
return 0;
}


/*
* Setting the seed allows arbitrary accumulators and flexible XOR policy
* If your algorithm starts with ~0, then XOR with ~0 before you set
Expand Down Expand Up @@ -89,15 +83,15 @@ static int crc32_update(struct shash_desc *desc, const u8 *data,
{
u32 *crcp = shash_desc_ctx(desc);

*crcp = __crc32_le(*crcp, data, len);
*crcp = crc32_le(*crcp, data, len);
return 0;
}

/* No final XOR 0xFFFFFFFF, like crc32_le */
static int __crc32_finup(u32 *crcp, const u8 *data, unsigned int len,
u8 *out)
{
put_unaligned_le32(__crc32_le(*crcp, data, len), out);
put_unaligned_le32(crc32_le(*crcp, data, len), out);
return 0;
}

Expand Down

0 comments on commit 6943546

Please sign in to comment.