summaryrefslogtreecommitdiff
path: root/crypto/skcipher.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-03-08 20:45:21 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-03-15 16:21:22 +0800
commit65775cf313987926e9746b0ca7f5519d297af2da (patch)
treedc1780648078be24407cdb67e591cf7e8478654c /crypto/skcipher.c
parentb949f55644a6d1645c0a71f78afabf12aec7c33b (diff)
crypto: scatterwalk - Change scatterwalk_next calling convention
Rather than returning the address and storing the length into an argument pointer, add an address field to the walk struct and use that to store the address. The length is returned directly. Change the done functions to use this stored address instead of getting them from the caller. Split the address into two using a union. The user should only access the const version so that it is never changed. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/skcipher.c')
-rw-r--r--crypto/skcipher.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index 66d19c360dd8..0c6911154241 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -41,12 +41,16 @@ static int skcipher_walk_next(struct skcipher_walk *walk);
static inline void skcipher_map_src(struct skcipher_walk *walk)
{
- walk->src.virt.addr = scatterwalk_map(&walk->in);
+ /* XXX */
+ walk->in.__addr = scatterwalk_map(&walk->in);
+ walk->src.virt.addr = walk->in.addr;
}
static inline void skcipher_map_dst(struct skcipher_walk *walk)
{
- walk->dst.virt.addr = scatterwalk_map(&walk->out);
+ /* XXX */
+ walk->out.__addr = scatterwalk_map(&walk->out);
+ walk->dst.virt.addr = walk->out.addr;
}
static inline gfp_t skcipher_walk_gfp(struct skcipher_walk *walk)
@@ -120,7 +124,7 @@ int skcipher_walk_done(struct skcipher_walk *walk, int res)
goto dst_done;
}
- scatterwalk_done_dst(&walk->out, walk->dst.virt.addr, n);
+ scatterwalk_done_dst(&walk->out, n);
dst_done:
if (res > 0)