mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
crypto: ablk_helper - Replace memcpy with struct assignment
tree: git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head:48e6dc1b2a
commit:a62b01cd6c
[20/24] crypto: create generic version of ablk_helper coccinelle warnings: (new ones prefixed by >>) >> crypto/ablk_helper.c:97:2-8: Replace memcpy with struct assignment >> crypto/ablk_helper.c:78:2-8: Replace memcpy with struct assignment Please consider folding the attached diff :-) Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
ac1ed0c0e1
commit
ea493d324f
@ -75,7 +75,7 @@ int ablk_encrypt(struct ablkcipher_request *req)
|
|||||||
struct ablkcipher_request *cryptd_req =
|
struct ablkcipher_request *cryptd_req =
|
||||||
ablkcipher_request_ctx(req);
|
ablkcipher_request_ctx(req);
|
||||||
|
|
||||||
memcpy(cryptd_req, req, sizeof(*req));
|
*cryptd_req = *req;
|
||||||
ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
|
ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
|
||||||
|
|
||||||
return crypto_ablkcipher_encrypt(cryptd_req);
|
return crypto_ablkcipher_encrypt(cryptd_req);
|
||||||
@ -94,7 +94,7 @@ int ablk_decrypt(struct ablkcipher_request *req)
|
|||||||
struct ablkcipher_request *cryptd_req =
|
struct ablkcipher_request *cryptd_req =
|
||||||
ablkcipher_request_ctx(req);
|
ablkcipher_request_ctx(req);
|
||||||
|
|
||||||
memcpy(cryptd_req, req, sizeof(*req));
|
*cryptd_req = *req;
|
||||||
ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
|
ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
|
||||||
|
|
||||||
return crypto_ablkcipher_decrypt(cryptd_req);
|
return crypto_ablkcipher_decrypt(cryptd_req);
|
||||||
|
Loading…
Reference in New Issue
Block a user