* [PATCH] hwrng: cctrng - add missing include to linux/fips.h
@ 2020-04-17 20:38 Hadar Gat
2020-04-17 21:34 ` Randy Dunlap
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Hadar Gat @ 2020-04-17 20:38 UTC (permalink / raw)
To: Hadar Gat, Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman
Cc: Gilad Ben-Yossef, Ofir Drang, linux-crypto, linux-kernel
This fixes build failure when CONFIG_CRYPTO_FIPS is defined.
Signed-off-by: Hadar Gat <hadar.gat@arm.com>
---
drivers/char/hw_random/cctrng.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index bdcd562..e82716c 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -15,6 +15,7 @@
#include <linux/completion.h>
#include <linux/of.h>
#include <linux/bitfield.h>
+#include <linux/fips.h>
#include "cctrng.h"
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] hwrng: cctrng - add missing include to linux/fips.h
2020-04-17 20:38 [PATCH] hwrng: cctrng - add missing include to linux/fips.h Hadar Gat
@ 2020-04-17 21:34 ` Randy Dunlap
2020-04-20 8:22 ` Herbert Xu
2020-04-20 8:28 ` hwrng: cctrng - Remove unnecessary FIPS ifdef Herbert Xu
2 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2020-04-17 21:34 UTC (permalink / raw)
To: Hadar Gat, Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman
Cc: Gilad Ben-Yossef, Ofir Drang, linux-crypto, linux-kernel
On 4/17/20 1:38 PM, Hadar Gat wrote:
> This fixes build failure when CONFIG_CRYPTO_FIPS is defined.
>
> Signed-off-by: Hadar Gat <hadar.gat@arm.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
> ---
> drivers/char/hw_random/cctrng.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
> index bdcd562..e82716c 100644
> --- a/drivers/char/hw_random/cctrng.c
> +++ b/drivers/char/hw_random/cctrng.c
> @@ -15,6 +15,7 @@
> #include <linux/completion.h>
> #include <linux/of.h>
> #include <linux/bitfield.h>
> +#include <linux/fips.h>
>
> #include "cctrng.h"
>
>
thanks.
--
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hwrng: cctrng - add missing include to linux/fips.h
2020-04-17 20:38 [PATCH] hwrng: cctrng - add missing include to linux/fips.h Hadar Gat
2020-04-17 21:34 ` Randy Dunlap
@ 2020-04-20 8:22 ` Herbert Xu
2020-04-20 8:28 ` hwrng: cctrng - Remove unnecessary FIPS ifdef Herbert Xu
2 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2020-04-20 8:22 UTC (permalink / raw)
To: Hadar Gat
Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
Gilad Ben-Yossef, Ofir Drang, linux-crypto, linux-kernel
On Fri, Apr 17, 2020 at 11:38:45PM +0300, Hadar Gat wrote:
> This fixes build failure when CONFIG_CRYPTO_FIPS is defined.
>
> Signed-off-by: Hadar Gat <hadar.gat@arm.com>
> ---
> drivers/char/hw_random/cctrng.c | 1 +
> 1 file changed, 1 insertion(+)
Patch applied. 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* hwrng: cctrng - Remove unnecessary FIPS ifdef
2020-04-17 20:38 [PATCH] hwrng: cctrng - add missing include to linux/fips.h Hadar Gat
2020-04-17 21:34 ` Randy Dunlap
2020-04-20 8:22 ` Herbert Xu
@ 2020-04-20 8:28 ` Herbert Xu
2020-04-20 8:36 ` Hadar Gat
2 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2020-04-20 8:28 UTC (permalink / raw)
To: Hadar Gat
Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
Gilad Ben-Yossef, Ofir Drang, linux-crypto, linux-kernel
This patch removes the unnecessary FIPS ifdef in cctrng.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: hwrng: cctrng - Remove unnecessary FIPS ifdef
2020-04-20 8:28 ` hwrng: cctrng - Remove unnecessary FIPS ifdef Herbert Xu
@ 2020-04-20 8:36 ` Hadar Gat
0 siblings, 0 replies; 5+ messages in thread
From: Hadar Gat @ 2020-04-20 8:36 UTC (permalink / raw)
To: Herbert Xu
Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
Gilad Ben-Yossef, Ofir Drang, linux-crypto, linux-kernel, nd
> -----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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-20 8:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 20:38 [PATCH] hwrng: cctrng - add missing include to linux/fips.h Hadar Gat
2020-04-17 21:34 ` Randy Dunlap
2020-04-20 8:22 ` Herbert Xu
2020-04-20 8:28 ` hwrng: cctrng - Remove unnecessary FIPS ifdef Herbert Xu
2020-04-20 8:36 ` Hadar Gat
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).