From: Herbert Xu <herbert@gondor.apana.org.au>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH] crypto: scatterwalk - Change scatterwalk_next calling convention
Date: Fri, 7 Mar 2025 11:05:19 +0800 [thread overview]
Message-ID: <Z8pib5_aZ61Z131Z@gondor.apana.org.au> (raw)
In-Reply-To: <20250306173438.GG1796@sol.localdomain>
On Thu, Mar 06, 2025 at 09:34:38AM -0800, Eric Biggers wrote:
> On Thu, Mar 06, 2025 at 10:52:48AM +0800, Herbert Xu wrote:
> > +static inline unsigned int scatterwalk_next(struct scatter_walk *walk,
> > + unsigned int total)
> > {
> > - *nbytes_ret = scatterwalk_clamp(walk, total);
> > - return scatterwalk_map(walk);
> > + total = scatterwalk_clamp(walk, total);
> > + walk->addr = scatterwalk_map(walk);
> > + return total;
> > }
>
> Maybe do:
>
> unsigned int nbytes = scatterwalk_clamp(walk, total);
>
> walk->addr = scatterwalk_map(walk);
> return nbytes;
>
> Otherwise 'total' is being reused for something that is not the total length,
> which might be confusing.
>
> > @@ -149,32 +150,30 @@ static inline void scatterwalk_advance(struct scatter_walk *walk,
> > /**
> > * scatterwalk_done_src() - Finish one step of a walk of source scatterlist
> > * @walk: the scatter_walk
> > - * @vaddr: the address returned by scatterwalk_next()
> > * @nbytes: the number of bytes processed this step, less than or equal to the
> > * number of bytes that scatterwalk_next() returned.
> > *
> > * Use this if the @vaddr was not written to, i.e. it is source data.
> > */
>
> The comment above still mentions @vaddr.
>
> > /**
> > * scatterwalk_done_dst() - Finish one step of a walk of destination scatterlist
> > * @walk: the scatter_walk
> > - * @vaddr: the address returned by scatterwalk_next()
> > * @nbytes: the number of bytes processed this step, less than or equal to the
> > * number of bytes that scatterwalk_next() returned.
> > *
> > * Use this if the @vaddr may have been written to, i.e. it is destination data.
> > */
>
> The comment above still mentions @vaddr.
OK I will fix these issues.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2025-03-07 3:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 2:52 [PATCH] crypto: scatterwalk - Change scatterwalk_next calling convention Herbert Xu
2025-03-06 3:10 ` Eric Biggers
2025-03-06 3:18 ` Herbert Xu
2025-03-06 3:36 ` Eric Biggers
2025-03-06 3:40 ` Herbert Xu
2025-03-06 3:59 ` Eric Biggers
2025-03-06 6:07 ` [PATCH] crypto: skcipher - Elinimate duplicate virt.addr field Herbert Xu
2025-03-06 17:29 ` Eric Biggers
2025-03-07 3:04 ` Herbert Xu
2025-03-06 17:34 ` [PATCH] crypto: scatterwalk - Change scatterwalk_next calling convention Eric Biggers
2025-03-07 3:05 ` Herbert Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z8pib5_aZ61Z131Z@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox