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 954a7064a179dc0ddac8f37d7e9838d4fb38e2e7..393a782679c7833e1556934a54c1a5a813f7c393 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 c16c94f88733e738f4ee1dff7a1334f9c2e39eb4..d0b92c1cd6e9b2a47d5a9dd1728ba70a13dc481c 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 12284183bd20a0c1ab54e9d737b29fa92ac4031c..ccf55fbb8bc2d6b7b889950215b14b3b77cff39e 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 880e6be9e95e1ddfae2661024227d165ad190d32..eac72840a7d2ef840e3c24b4c2f7ecffa8765df6 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 748914abdb604e6434db7d8326e8a8480567e1da..4e1ec12bc0fb32ac45beee3e346115c25e6f7b9f 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,