crypto: scatterwalk - remove 'chain' argument from scatterwalk_crypto_chain()

All callers pass chain=0 to scatterwalk_crypto_chain().

Remove this unneeded parameter.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Eric Biggers 2018-07-23 10:01:33 -07:00 committed by Herbert Xu
parent 0567fc9e90
commit 8c30fbe63e
5 changed files with 7 additions and 13 deletions

View file

@ -188,7 +188,7 @@ static int post_crypt(struct skcipher_request *req)
if (rctx->dst != sg) { if (rctx->dst != sg) {
rctx->dst[0] = *sg; rctx->dst[0] = *sg;
sg_unmark_end(rctx->dst); sg_unmark_end(rctx->dst);
scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 0, 2); scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2);
} }
rctx->dst[0].length -= offset - sg->offset; rctx->dst[0].length -= offset - sg->offset;
rctx->dst[0].offset = offset; rctx->dst[0].offset = offset;
@ -265,7 +265,7 @@ static int pre_crypt(struct skcipher_request *req)
if (rctx->src != sg) { if (rctx->src != sg) {
rctx->src[0] = *sg; rctx->src[0] = *sg;
sg_unmark_end(rctx->src); sg_unmark_end(rctx->src);
scatterwalk_crypto_chain(rctx->src, sg_next(sg), 0, 2); scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2);
} }
rctx->src[0].length -= offset - sg->offset; rctx->src[0].length -= offset - sg->offset;
rctx->src[0].offset = offset; rctx->src[0].offset = offset;

View file

@ -91,7 +91,7 @@ struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2],
sg_init_table(dst, 2); sg_init_table(dst, 2);
sg_set_page(dst, sg_page(src), src->length - len, src->offset + len); sg_set_page(dst, sg_page(src), src->length - len, src->offset + len);
scatterwalk_crypto_chain(dst, sg_next(src), 0, 2); scatterwalk_crypto_chain(dst, sg_next(src), 2);
return dst; return dst;
} }

View file

@ -138,7 +138,7 @@ static int post_crypt(struct skcipher_request *req)
if (rctx->dst != sg) { if (rctx->dst != sg) {
rctx->dst[0] = *sg; rctx->dst[0] = *sg;
sg_unmark_end(rctx->dst); sg_unmark_end(rctx->dst);
scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 0, 2); scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2);
} }
rctx->dst[0].length -= offset - sg->offset; rctx->dst[0].length -= offset - sg->offset;
rctx->dst[0].offset = offset; rctx->dst[0].offset = offset;
@ -204,7 +204,7 @@ static int pre_crypt(struct skcipher_request *req)
if (rctx->src != sg) { if (rctx->src != sg) {
rctx->src[0] = *sg; rctx->src[0] = *sg;
sg_unmark_end(rctx->src); sg_unmark_end(rctx->src);
scatterwalk_crypto_chain(rctx->src, sg_next(sg), 0, 2); scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2);
} }
rctx->src[0].length -= offset - sg->offset; rctx->src[0].length -= offset - sg->offset;
rctx->src[0].offset = offset; rctx->src[0].offset = offset;

View file

@ -22,14 +22,8 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
static inline void scatterwalk_crypto_chain(struct scatterlist *head, static inline void scatterwalk_crypto_chain(struct scatterlist *head,
struct scatterlist *sg, struct scatterlist *sg, int num)
int chain, int num)
{ {
if (chain) {
head->length += sg->length;
sg = sg_next(sg);
}
if (sg) if (sg)
sg_chain(head, num, sg); sg_chain(head, num, sg);
else else

View file

@ -42,7 +42,7 @@ static void chain_to_walk(struct scatterlist *sg, struct scatter_walk *walk)
sg_set_page(sg, sg_page(src), sg_set_page(sg, sg_page(src),
src->length - diff, walk->offset); src->length - diff, walk->offset);
scatterwalk_crypto_chain(sg, sg_next(src), 0, 2); scatterwalk_crypto_chain(sg, sg_next(src), 2);
} }
static int tls_enc_record(struct aead_request *aead_req, static int tls_enc_record(struct aead_request *aead_req,