Re: [v2 PATCH 3/3] crypto: skcipher - Eliminate duplicate virt.addr field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 07, 2025 at 11:36:21AM +0800, Herbert Xu wrote:
> diff --git a/crypto/skcipher.c b/crypto/skcipher.c
> index 92def074374a..24bb78f45bfb 100644
> --- a/crypto/skcipher.c
> +++ b/crypto/skcipher.c
> @@ -43,14 +43,12 @@ static inline void skcipher_map_src(struct skcipher_walk *walk)
>  {
>  	/* XXX */
>  	walk->in.maddr = scatterwalk_map(&walk->in);
> -	walk->src.virt.addr = walk->in.addr;
>  }

This patch makes all the callers of scatterwalk_map() assign the returned
address to the struct scatter_walk itself.  So that should just be done by
scatterwalk_map() itself.  Then skcipher_map_src() and skcipher_map_dst() should
be removed and the callers updated to use scatterwalk_map(&walk->in) and
scatterwalk_map(&walk->out) directly.

> @@ -214,7 +209,7 @@ static int skcipher_next_fast(struct skcipher_walk *walk)
>  		(u8 *)(sg_page(walk->out.sg) + (walk->out.offset >> PAGE_SHIFT));
>  
>  	skcipher_map_src(walk);
> -	walk->dst.virt.addr = walk->src.virt.addr;
> +	walk->out.maddr = walk->in.maddr;
>  
>  	if (diff) {
>  		walk->flags |= SKCIPHER_WALK_DIFF;

Note that this will have to be rebased on top of
https://lore.kernel.org/r/20250306033305.163767-1-ebiggers@xxxxxxxxxx
(sorry for missing that earlier).

- Eric




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux