2020-04-20 09:14:18

by Murphy Zhou

[permalink] [raw]
Subject: [PATCH] [linux-next] hwrng: cctrng - fix missing fips header

In linux-next tree, this is causing build error:

drivers/char/hw_random/cctrng.c: In function ‘cc_trng_compwork_handler’:
drivers/char/hw_random/cctrng.c:334:49: error: ‘fips_enabled’ undeclared (first use in this function); did you mean ‘nx_enabled’?
if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
^~~~~~~~~~~~
nx_enabled
drivers/char/hw_random/cctrng.c:334:49: note: each undeclared identifier is reported only once for each function it appears in
drivers/char/hw_random/cctrng.c:335:3: error: implicit declaration of function ‘fips_fail_notify’; did you mean ‘sysfs_notify’?
[-Werror=implicit-function-declaration]
fips_fail_notify();
^~~~~~~~~~~~~~~~
sysfs_notify
cc1: some warnings being treated as errors

Signed-off-by: Murphy Zhou <[email protected]>
---
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 bdcd56243104..e82716c12c3a 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.18.1


2020-04-20 15:27:12

by Hadar Gat

[permalink] [raw]
Subject: RE: [PATCH] [linux-next] hwrng: cctrng - fix missing fips header


> -----Original Message-----
> From: Murphy Zhou <[email protected]>
> Sent: Monday, 20 April 2020 12:13
>
> In linux-next tree, this is causing build error:
>
> drivers/char/hw_random/cctrng.c: In function ‘cc_trng_compwork_handler’:
> drivers/char/hw_random/cctrng.c:334:49: error: ‘fips_enabled’ undeclared
> (first use in this function); did you mean ‘nx_enabled’?
> if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
> ^~~~~~~~~~~~
> nx_enabled
> drivers/char/hw_random/cctrng.c:334:49: note: each undeclared identifier is
> reported only once for each function it appears in
> drivers/char/hw_random/cctrng.c:335:3: error: implicit declaration of
> function ‘fips_fail_notify’; did you mean ‘sysfs_notify’?
> [-Werror=implicit-function-declaration]
> fips_fail_notify();
> ^~~~~~~~~~~~~~~~
> sysfs_notify
> cc1: some warnings being treated as errors
>
> Signed-off-by: Murphy Zhou <[email protected]>
> ---
> 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 bdcd56243104..e82716c12c3a
> 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.18.1

Thanks Murphy for reporting.
This compilation issue was fixed few days ago and already applied.
BR,
Hadar