lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZFx6PXL9LzyDRoER@gondor.apana.org.au>
Date:   Thu, 11 May 2023 13:16:45 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Martin Kaiser <martin@...ser.cx>
Cc:     linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] hwrng: imx-rngc - use bitfield macros to read fifo
 level

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@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ