crypto: authenc - Remove redundant sg_init_table call.

Remove redundant sg_init_table call. scatterwalk_ffwd doing the same.

Signed-off-by: Harsh Jain <harshjain.prof@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Harsh Jain 2016-06-29 00:24:43 +05:30 committed by Herbert Xu
parent 72259deb3a
commit c34252fd71
1 changed files with 1 additions and 6 deletions

View File

@ -206,7 +206,6 @@ static int crypto_authenc_encrypt(struct aead_request *req)
struct scatterlist *src, *dst; struct scatterlist *src, *dst;
int err; int err;
sg_init_table(areq_ctx->src, 2);
src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen);
dst = src; dst = src;
@ -215,7 +214,6 @@ static int crypto_authenc_encrypt(struct aead_request *req)
if (err) if (err)
return err; return err;
sg_init_table(areq_ctx->dst, 2);
dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);
} }
@ -251,14 +249,11 @@ static int crypto_authenc_decrypt_tail(struct aead_request *req,
if (crypto_memneq(ihash, ahreq->result, authsize)) if (crypto_memneq(ihash, ahreq->result, authsize))
return -EBADMSG; return -EBADMSG;
sg_init_table(areq_ctx->src, 2);
src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen);
dst = src; dst = src;
if (req->src != req->dst) { if (req->src != req->dst)
sg_init_table(areq_ctx->dst, 2);
dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);
}
ablkcipher_request_set_tfm(abreq, ctx->enc); ablkcipher_request_set_tfm(abreq, ctx->enc);
ablkcipher_request_set_callback(abreq, aead_request_flags(req), ablkcipher_request_set_callback(abreq, aead_request_flags(req),