hwrng: imx-rngc - simpler check for available random bytes
authorMartin Kaiser <martin@kaiser.cx>
Fri, 19 May 2023 16:04:31 +0000 (18:04 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 24 May 2023 10:12:33 +0000 (18:12 +0800)
commit97ecafc4f6566f538bbde09d3a8baae4a3419eef
tree039f0e666ca1bf1c821abe147309cf875e5f81b2
parentb7be31b0d5088507b745bfa014798e52fad6dc7a
hwrng: imx-rngc - simpler check for available random bytes

The "level" field in the status register contains the number of random
bytes that are available in the FIFO.  Use GENMASK to extract this field.
We only want to check if level is 0 or if we can read another byte.
There's no need for the shift or the level variable.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/imx-rngc.c