summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-07-23 13:01:33 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2018-08-03 06:06:03 -0400
commit8c30fbe63e4eff1b221f8db70ae5c48a9331eae0 (patch)
tree9e4e0fde893784009f5372deebd1c09c2b88b2c3
parent0567fc9e90b9b1c8dbce8a5468758e6206744d4a (diff)
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>
-rw-r--r--crypto/lrw.c4
-rw-r--r--crypto/scatterwalk.c2
-rw-r--r--crypto/xts.c4
-rw-r--r--include/crypto/scatterwalk.h8
-rw-r--r--net/tls/tls_device_fallback.c2
5 files changed, 7 insertions, 13 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c
index 954a7064a179..393a782679c7 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -188,7 +188,7 @@ static int post_crypt(struct skcipher_request *req)
188 if (rctx->dst != sg) { 188 if (rctx->dst != sg) {
189 rctx->dst[0] = *sg; 189 rctx->dst[0] = *sg;
190 sg_unmark_end(rctx->dst); 190 sg_unmark_end(rctx->dst);
191 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 0, 2); 191 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2);
192 } 192 }
193 rctx->dst[0].length -= offset - sg->offset; 193 rctx->dst[0].length -= offset - sg->offset;
194 rctx->dst[0].offset = offset; 194 rctx->dst[0].offset = offset;
@@ -265,7 +265,7 @@ static int pre_crypt(struct skcipher_request *req)
265 if (rctx->src != sg) { 265 if (rctx->src != sg) {
266 rctx->src[0] = *sg; 266 rctx->src[0] = *sg;
267 sg_unmark_end(rctx->src); 267 sg_unmark_end(rctx->src);
268 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 0, 2); 268 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2);
269 } 269 }
270 rctx->src[0].length -= offset - sg->offset; 270 rctx->src[0].length -= offset - sg->offset;
271 rctx->src[0].offset = offset; 271 rctx->src[0].offset = offset;
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c
index c16c94f88733..d0b92c1cd6e9 100644
--- a/crypto/scatterwalk.c
+++ b/crypto/scatterwalk.c
@@ -91,7 +91,7 @@ struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2],
91 91
92 sg_init_table(dst, 2); 92 sg_init_table(dst, 2);
93 sg_set_page(dst, sg_page(src), src->length - len, src->offset + len); 93 sg_set_page(dst, sg_page(src), src->length - len, src->offset + len);
94 scatterwalk_crypto_chain(dst, sg_next(src), 0, 2); 94 scatterwalk_crypto_chain(dst, sg_next(src), 2);
95 95
96 return dst; 96 return dst;
97} 97}
diff --git a/crypto/xts.c b/crypto/xts.c
index 12284183bd20..ccf55fbb8bc2 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -138,7 +138,7 @@ static int post_crypt(struct skcipher_request *req)
138 if (rctx->dst != sg) { 138 if (rctx->dst != sg) {
139 rctx->dst[0] = *sg; 139 rctx->dst[0] = *sg;
140 sg_unmark_end(rctx->dst); 140 sg_unmark_end(rctx->dst);
141 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 0, 2); 141 scatterwalk_crypto_chain(rctx->dst, sg_next(sg), 2);
142 } 142 }
143 rctx->dst[0].length -= offset - sg->offset; 143 rctx->dst[0].length -= offset - sg->offset;
144 rctx->dst[0].offset = offset; 144 rctx->dst[0].offset = offset;
@@ -204,7 +204,7 @@ static int pre_crypt(struct skcipher_request *req)
204 if (rctx->src != sg) { 204 if (rctx->src != sg) {
205 rctx->src[0] = *sg; 205 rctx->src[0] = *sg;
206 sg_unmark_end(rctx->src); 206 sg_unmark_end(rctx->src);
207 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 0, 2); 207 scatterwalk_crypto_chain(rctx->src, sg_next(sg), 2);
208 } 208 }
209 rctx->src[0].length -= offset - sg->offset; 209 rctx->src[0].length -= offset - sg->offset;
210 rctx->src[0].offset = offset; 210 rctx->src[0].offset = offset;
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 880e6be9e95e..eac72840a7d2 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -22,14 +22,8 @@
22#include <linux/scatterlist.h> 22#include <linux/scatterlist.h>
23 23
24static inline void scatterwalk_crypto_chain(struct scatterlist *head, 24static inline void scatterwalk_crypto_chain(struct scatterlist *head,
25 struct scatterlist *sg, 25 struct scatterlist *sg, int num)
26 int chain, int num)
27{ 26{
28 if (chain) {
29 head->length += sg->length;
30 sg = sg_next(sg);
31 }
32
33 if (sg) 27 if (sg)
34 sg_chain(head, num, sg); 28 sg_chain(head, num, sg);
35 else 29 else
diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c
index 748914abdb60..4e1ec12bc0fb 100644
--- a/net/tls/tls_device_fallback.c
+++ b/net/tls/tls_device_fallback.c
@@ -42,7 +42,7 @@ static void chain_to_walk(struct scatterlist *sg, struct scatter_walk *walk)
42 sg_set_page(sg, sg_page(src), 42 sg_set_page(sg, sg_page(src),
43 src->length - diff, walk->offset); 43 src->length - diff, walk->offset);
44 44
45 scatterwalk_crypto_chain(sg, sg_next(src), 0, 2); 45 scatterwalk_crypto_chain(sg, sg_next(src), 2);
46} 46}
47 47
48static int tls_enc_record(struct aead_request *aead_req, 48static int tls_enc_record(struct aead_request *aead_req,