summaryrefslogtreecommitdiff
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/crypto/nx/nx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/crypto/nx/nx.c b/drivers/crypto/nx/nx.c
index dd95e5361d88..a3b979193d9b 100644
--- a/drivers/crypto/nx/nx.c
+++ b/drivers/crypto/nx/nx.c
@@ -154,17 +154,16 @@ struct nx_sg *nx_walk_and_build(struct nx_sg *nx_dst,
struct scatter_walk walk;
struct nx_sg *nx_sg = nx_dst;
unsigned int n, len = *src_len;
- char *dst;
/* we need to fast forward through @start bytes first */
scatterwalk_start_at_pos(&walk, sg_src, start);
while (len && (nx_sg - nx_dst) < sglen) {
- dst = scatterwalk_next(&walk, len, &n);
+ n = scatterwalk_next(&walk, len);
- nx_sg = nx_build_sg_list(nx_sg, dst, &n, sglen - (nx_sg - nx_dst));
+ nx_sg = nx_build_sg_list(nx_sg, walk.addr, &n, sglen - (nx_sg - nx_dst));
- scatterwalk_done_src(&walk, dst, n);
+ scatterwalk_done_src(&walk, n);
len -= n;
}
/* update to_process */