public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Tomas Marek <tomas.marek@elrest.cz>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: mpm@selenic.com, mcoquelin.stm32@gmail.com,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	alexandre.torgue@foss.st.com, oleg.karfich@wago.com
Subject: Re: [PATCH 1/2] hwrng: stm32 - fix number of returned bytes on read
Date: Tue, 25 Oct 2022 16:41:38 +0200	[thread overview]
Message-ID: <20221025144138.GA8@edaa77c5b7e3> (raw)
In-Reply-To: <Y1J3QwynPFIlfrIv@loth.rohan.me.apana.org.au>

On Fri, Oct 21, 2022 at 06:41:07PM +0800, Herbert Xu wrote:
> On Wed, Oct 12, 2022 at 06:09:23PM +0200, Tomas Marek wrote:
> >
> > diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
> > index bc22178f83e8..8eaacefd498b 100644
> > --- a/drivers/char/hw_random/stm32-rng.c
> > +++ b/drivers/char/hw_random/stm32-rng.c
> > @@ -49,11 +49,13 @@ static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
> >  		/* Manage timeout which is based on timer and take */
> >  		/* care of initial delay time when enabling rng	*/
> >  		if (!sr && wait) {
> > -			retval = readl_relaxed_poll_timeout_atomic(priv->base
> > +			int ret;
> > +
> > +			ret = readl_relaxed_poll_timeout_atomic(priv->base
> 
> This would make a lot more sense if you called it err instead of ret.
> 
> But as you're fixing a real bug I'm going to apply your patch as is
> and you can post an incremental patch to improve it.

OK, sounds reasonable. I'll post new patch and rename ret to err.

Thanks for the hint and for the review.

Tomas

> 
> 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-10-25 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 16:09 [PATCH 0/2] hwrng: stm32 - improve performance Tomas Marek
2022-10-12 16:09 ` [PATCH 1/2] hwrng: stm32 - fix number of returned bytes on read Tomas Marek
2022-10-21 10:41   ` Herbert Xu
2022-10-25 14:41     ` Tomas Marek [this message]
2022-10-12 16:09 ` [PATCH 2/2] hwrng: stm32 - fix read of the last word Tomas Marek
2022-10-21 11:39 ` [PATCH 0/2] hwrng: stm32 - improve performance Herbert Xu

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=20221025144138.GA8@edaa77c5b7e3 \
    --to=tomas.marek@elrest.cz \
    --cc=alexandre.torgue@foss.st.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mpm@selenic.com \
    --cc=oleg.karfich@wago.com \
    /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