crypto: scatterwalk - remove 'chain' argument from scatterwalk_crypto_chain()
authorEric Biggers <ebiggers@google.com>
Mon, 23 Jul 2018 17:01:33 +0000 (10:01 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Aug 2018 10:06:03 +0000 (18:06 +0800)
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>
crypto/lrw.c
crypto/scatterwalk.c
crypto/xts.c
include/crypto/scatterwalk.h
net/tls/tls_device_fallback.c

index 954a706..393a782 100644 (file)
@@ -188,7 +188,7 @@ static int post_crypt(struct skcipher_request *req)
        if (rctx->dst != sg) {
                rctx->dst[0] = *sg;
                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].offset = offset;
@@ -265,7 +265,7 @@ static int pre_crypt(struct skcipher_request *req)
        if (rctx->src != sg) {
                rctx->src[0] = *sg;
                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].offset = offset;
index c16c94f..d0b92c1 100644 (file)
@@ -91,7 +91,7 @@ struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2],
 
        sg_init_table(dst, 2);
        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;
 }
index 1228418..ccf55fb 100644 (file)
@@ -138,7 +138,7 @@ static int post_crypt(struct skcipher_request *req)
        if (rctx->dst != sg) {
                rctx->dst[0] = *sg;
                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].offset = offset;
@@ -204,7 +204,7 @@ static int pre_crypt(struct skcipher_request *req)
        if (rctx->src != sg) {
                rctx->src[0] = *sg;
                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].offset = offset;
index 880e6be..eac7284 100644 (file)
 #include <linux/scatterlist.h>
 
 static inline void scatterwalk_crypto_chain(struct scatterlist *head,
-                                           struct scatterlist *sg,
-                                           int chain, int num)
+                                           struct scatterlist *sg, int num)
 {
-       if (chain) {
-               head->length += sg->length;
-               sg = sg_next(sg);
-       }
-
        if (sg)
                sg_chain(head, num, sg);
        else
index 748914a..4e1ec12 100644 (file)
@@ -42,7 +42,7 @@ static void chain_to_walk(struct scatterlist *sg, struct scatter_walk *walk)
        sg_set_page(sg, sg_page(src),
                    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,