hwrng: cctrng - Remove unnecessary FIPS ifdef
diff mbox series

Message ID 20200420082819.GA23022@gondor.apana.org.au
State Accepted
Commit b2d7e8bcaab7d1d931369984e2bae952247a1412
Headers show
Series
  • hwrng: cctrng - Remove unnecessary FIPS ifdef
Related show

Commit Message

Herbert Xu April 20, 2020, 8:28 a.m. UTC
This patch removes the unnecessary FIPS ifdef in cctrng.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Comments

Hadar Gat April 20, 2020, 8:36 a.m. UTC | #1
> -----Original Message-----
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Sent: Monday, 20 April 2020 11:28
> To: Hadar Gat <Hadar.Gat@arm.com>
> Cc: Matt Mackall <mpm@selenic.com>; Arnd Bergmann <arnd@arndb.de>;
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Gilad Ben-Yossef
> <gilad@benyossef.com>; Ofir Drang <Ofir.Drang@arm.com>; linux-
> crypto@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: hwrng: cctrng - Remove unnecessary FIPS ifdef
> 
> This patch removes the unnecessary FIPS ifdef in cctrng.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 

Acked-by: Hadar Gat <hadar.gat@arm.com>


> diff --git a/drivers/char/hw_random/cctrng.c
> b/drivers/char/hw_random/cctrng.c index e82716c12c3a..49fb65a221f3
> 100644
> --- a/drivers/char/hw_random/cctrng.c
> +++ b/drivers/char/hw_random/cctrng.c
> @@ -331,13 +331,11 @@ void cc_trng_compwork_handler(struct
> work_struct *w)
>  	ehr_valid = CC_REG_FLD_GET(RNG_ISR, EHR_VALID, isr);
>  	dev_dbg(dev, "Got RNG_ISR=0x%08X (EHR_VALID=%u)\n", isr,
> ehr_valid);
> 
> -#ifdef CONFIG_CRYPTO_FIPS
> -	if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
> +	if (fips_enabled && CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr)) {
>  		fips_fail_notify();
>  		/* FIPS error is fatal */
>  		panic("Got HW CRNGT error while fips is enabled!\n");
>  	}
> -#endif
> 
>  	/* Clear all pending RNG interrupts */
>  	cc_iowrite(drvdata, CC_RNG_ICR_REG_OFFSET, isr);
> --
> 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

Patch
diff mbox series

diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index e82716c12c3a..49fb65a221f3 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -331,13 +331,11 @@  void cc_trng_compwork_handler(struct work_struct *w)
 	ehr_valid = CC_REG_FLD_GET(RNG_ISR, EHR_VALID, isr);
 	dev_dbg(dev, "Got RNG_ISR=0x%08X (EHR_VALID=%u)\n", isr, ehr_valid);
 
-#ifdef CONFIG_CRYPTO_FIPS
-	if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
+	if (fips_enabled && CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr)) {
 		fips_fail_notify();
 		/* FIPS error is fatal */
 		panic("Got HW CRNGT error while fips is enabled!\n");
 	}
-#endif
 
 	/* Clear all pending RNG interrupts */
 	cc_iowrite(drvdata, CC_RNG_ICR_REG_OFFSET, isr);