Skip to content

Commit d97d066

Browse files
ebiggersherbertx
authored andcommitted
crypto: skcipher - fold skcipher_walk_skcipher() into skcipher_walk_virt()
Fold skcipher_walk_skcipher() into skcipher_walk_virt() which is its only remaining caller. No change in behavior. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 24300d2 commit d97d066

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

crypto/skcipher.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,22 @@ static int skcipher_walk_first(struct skcipher_walk *walk)
306306
return skcipher_walk_next(walk);
307307
}
308308

309-
static int skcipher_walk_skcipher(struct skcipher_walk *walk,
310-
struct skcipher_request *req)
309+
int skcipher_walk_virt(struct skcipher_walk *walk,
310+
struct skcipher_request *req, bool atomic)
311311
{
312312
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
313313
struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
314+
int err = 0;
315+
316+
might_sleep_if(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP);
314317

315318
walk->total = req->cryptlen;
316319
walk->nbytes = 0;
317320
walk->iv = req->iv;
318321
walk->oiv = req->iv;
319322

320323
if (unlikely(!walk->total))
321-
return 0;
324+
goto out;
322325

323326
scatterwalk_start(&walk->in, req->src);
324327
scatterwalk_start(&walk->out, req->dst);
@@ -336,18 +339,8 @@ static int skcipher_walk_skcipher(struct skcipher_walk *walk,
336339
else
337340
walk->stride = alg->walksize;
338341

339-
return skcipher_walk_first(walk);
340-
}
341-
342-
int skcipher_walk_virt(struct skcipher_walk *walk,
343-
struct skcipher_request *req, bool atomic)
344-
{
345-
int err;
346-
347-
might_sleep_if(req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP);
348-
349-
err = skcipher_walk_skcipher(walk, req);
350-
342+
err = skcipher_walk_first(walk);
343+
out:
351344
walk->flags &= atomic ? ~SKCIPHER_WALK_SLEEP : ~0;
352345

353346
return err;

0 commit comments

Comments
 (0)