diff options
author | Thomas Gleixner <[email protected]> | 2018-06-22 21:20:35 +0200 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2018-06-22 21:20:35 +0200 |
commit | 7731b8bc94e599c9a79e428f3359ff2c34b7576a (patch) | |
tree | 879f18ccbe274122f2d4f095b43cbc7f953e0ada /crypto/crc32c_generic.c | |
parent | 48e315618dc4dc8904182cd221e3d395d5d97005 (diff) | |
parent | 9ffc59d57228d74809700be6f7ecb1db10292f05 (diff) |
Merge branch 'linus' into x86/urgent
Required to queue a dependent fix.
Diffstat (limited to 'crypto/crc32c_generic.c')
-rw-r--r-- | crypto/crc32c_generic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/crc32c_generic.c b/crypto/crc32c_generic.c index 372320399622..7283066ecc98 100644 --- a/crypto/crc32c_generic.c +++ b/crypto/crc32c_generic.c @@ -35,6 +35,7 @@ * */ +#include <asm/unaligned.h> #include <crypto/internal/hash.h> #include <linux/init.h> #include <linux/module.h> @@ -82,7 +83,7 @@ static int chksum_setkey(struct crypto_shash *tfm, const u8 *key, crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); return -EINVAL; } - mctx->key = le32_to_cpu(*(__le32 *)key); + mctx->key = get_unaligned_le32(key); return 0; } @@ -99,13 +100,13 @@ static int chksum_final(struct shash_desc *desc, u8 *out) { struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); - *(__le32 *)out = ~cpu_to_le32p(&ctx->crc); + put_unaligned_le32(~ctx->crc, out); return 0; } static int __chksum_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) { - *(__le32 *)out = ~cpu_to_le32(__crc32c_le(*crcp, data, len)); + put_unaligned_le32(~__crc32c_le(*crcp, data, len), out); return 0; } @@ -148,7 +149,6 @@ static struct shash_alg alg = { .cra_priority = 100, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_alignmask = 3, .cra_ctxsize = sizeof(struct chksum_ctx), .cra_module = THIS_MODULE, .cra_init = crc32c_cra_init, |