From: Herbert Xu <herbert@gondor.apana.org.au>
To: Martin Kaiser <martin@kaiser.cx>
Cc: linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] hwrng: imx-rngc - use bitfield macros to read fifo level
Date: Thu, 11 May 2023 13:16:45 +0800 [thread overview]
Message-ID: <ZFx6PXL9LzyDRoER@gondor.apana.org.au> (raw)
In-Reply-To: <20230427185357.923412-2-martin@kaiser.cx>
On Thu, Apr 27, 2023 at 08:53:55PM +0200, Martin Kaiser wrote:
>
> @@ -133,9 +133,7 @@ static int imx_rngc_read(struct hwrng *rng, void *data, size_t max, bool wait)
> break;
>
> /* how many random numbers are in FIFO? [0-16] */
> - level = (status & RNGC_STATUS_FIFO_LEVEL_MASK) >>
> - RNGC_STATUS_FIFO_LEVEL_SHIFT;
> -
> + level = FIELD_GET(RNGC_STATUS_FIFO_LEVEL, status);
Wouldn't it be simpler to just get rid of the shift?
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
next prev parent reply other threads:[~2023-05-11 5:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 18:53 [PATCH 0/3] hwrng: imx-rngc - simplify register definitions Martin Kaiser
2023-04-27 18:53 ` [PATCH 1/3] hwrng: imx-rngc - use bitfield macros to read fifo level Martin Kaiser
2023-05-11 5:16 ` Herbert Xu [this message]
2023-05-11 7:43 ` Martin Kaiser
2023-04-27 18:53 ` [PATCH 2/3] hwrng: imx-rngc - use bitfield macros to read rng type Martin Kaiser
2023-04-27 18:53 ` [PATCH 3/3] hwrng: imx-rngc - use BIT(x) for register bit defines Martin Kaiser
2023-05-19 16:04 ` [PATCH v2 0/3] hwrng: imx-rngc - simplify register definitions Martin Kaiser
2023-05-19 16:04 ` [PATCH v2 1/3] hwrng: imx-rngc - simpler check for available random bytes Martin Kaiser
2023-05-19 16:04 ` [PATCH v2 2/3] hwrng: imx-rngc - use bitfield macros to read rng type Martin Kaiser
2023-05-19 16:04 ` [PATCH v2 3/3] hwrng: imx-rngc - use BIT(x) for register bit defines Martin Kaiser
2023-05-24 10:14 ` [PATCH v2 0/3] hwrng: imx-rngc - simplify register definitions 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=ZFx6PXL9LzyDRoER@gondor.apana.org.au \
--to=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=martin@kaiser.cx \
/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;
as well as URLs for NNTP newsgroup(s).