]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
crypto: ablk_helper - Replace memcpy with struct assignment
authorkbuild test robot <fengguang.wu@intel.com>
Tue, 24 Sep 2013 00:21:29 +0000 (08:21 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 7 Oct 2013 06:16:57 +0000 (14:16 +0800)
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   48e6dc1b2a1ad8186d48968d5018912bdacac744
commit: a62b01cd6cc1feb5e80d64d6937c291473ed82cb [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>
crypto/ablk_helper.c

index 62568b1fc885fa2f9f4ef61d61f1772339acc6c8..ffe7278d4bd83bd9b8ee5e7392af7bd417e037ae 100644 (file)
@@ -75,7 +75,7 @@ int ablk_encrypt(struct ablkcipher_request *req)
                struct ablkcipher_request *cryptd_req =
                        ablkcipher_request_ctx(req);
 
-               memcpy(cryptd_req, req, sizeof(*req));
+               *cryptd_req = *req;
                ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
 
                return crypto_ablkcipher_encrypt(cryptd_req);
@@ -94,7 +94,7 @@ int ablk_decrypt(struct ablkcipher_request *req)
                struct ablkcipher_request *cryptd_req =
                        ablkcipher_request_ctx(req);
 
-               memcpy(cryptd_req, req, sizeof(*req));
+               *cryptd_req = *req;
                ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
 
                return crypto_ablkcipher_decrypt(cryptd_req);