2020-04-27 05:44:12

by Hadar Gat

[permalink] [raw]
Subject: [PATCH 2/3] hwrng: cctrng - change default to n

For many users, the Arm CryptoCell HW is not available, so the
default for HW_RANDOM_CCTRNG changed to n.

Signed-off-by: Hadar Gat <[email protected]>
---
drivers/char/hw_random/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index df2d001..0938d3d 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -476,8 +476,8 @@ config HW_RANDOM_KEYSTONE

config HW_RANDOM_CCTRNG
tristate "Arm CryptoCell True Random Number Generator support"
- depends on HAS_IOMEM & OF
- default HW_RANDOM
+ depends on HW_RANDOM & HAS_IOMEM & OF
+ default n
help
This driver provides support for the True Random Number
Generator available in Arm TrustZone CryptoCell.
--
2.7.4


2020-04-27 07:01:28

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH 2/3] hwrng: cctrng - change default to n

On Mon, 27 Apr 2020 at 07:42, Hadar Gat <[email protected]> wrote:
>
> For many users, the Arm CryptoCell HW is not available, so the
> default for HW_RANDOM_CCTRNG changed to n.
>
> Signed-off-by: Hadar Gat <[email protected]>
> ---
> drivers/char/hw_random/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> index df2d001..0938d3d 100644
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -476,8 +476,8 @@ config HW_RANDOM_KEYSTONE
>
> config HW_RANDOM_CCTRNG
> tristate "Arm CryptoCell True Random Number Generator support"
> - depends on HAS_IOMEM & OF
> - default HW_RANDOM
> + depends on HW_RANDOM & HAS_IOMEM & OF

The whole block is guarded by if HW_RANDOM, so I don't think you need
the dependency here.

> + default n

'default n' is the default so you can just remove the line

> help
> This driver provides support for the True Random Number
> Generator available in Arm TrustZone CryptoCell.
> --
> 2.7.4
>

2020-04-27 07:29:21

by Hadar Gat

[permalink] [raw]
Subject: RE: [PATCH 2/3] hwrng: cctrng - change default to n


> -----Original Message-----
> From: Ard Biesheuvel <[email protected]>
>
> On Mon, 27 Apr 2020 at 07:42, Hadar Gat <[email protected]> wrote:
> >
> > For many users, the Arm CryptoCell HW is not available, so the default
> > for HW_RANDOM_CCTRNG changed to n.
> >
> > Signed-off-by: Hadar Gat <[email protected]>
> > ---
> > drivers/char/hw_random/Kconfig | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/char/hw_random/Kconfig
> > b/drivers/char/hw_random/Kconfig index df2d001..0938d3d 100644
> > --- a/drivers/char/hw_random/Kconfig
> > +++ b/drivers/char/hw_random/Kconfig
> > @@ -476,8 +476,8 @@ config HW_RANDOM_KEYSTONE
> >
> > config HW_RANDOM_CCTRNG
> > tristate "Arm CryptoCell True Random Number Generator support"
> > - depends on HAS_IOMEM & OF
> > - default HW_RANDOM
> > + depends on HW_RANDOM & HAS_IOMEM & OF
>
> The whole block is guarded by if HW_RANDOM, so I don't think you need the
> dependency here.
>
> > + default n
>
> 'default n' is the default so you can just remove the line

Is this a guideline or just optional?
Personally I like things to be explicit and if allowed I prefer to keep this line.

>
> > help
> > This driver provides support for the True Random Number
> > Generator available in Arm TrustZone CryptoCell.
> > --
> > 2.7.4
> >

2020-04-27 08:22:35

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 2/3] hwrng: cctrng - change default to n

On Mon, Apr 27, 2020 at 9:26 AM Hadar Gat <[email protected]> wrote:
> > -----Original Message-----
> > From: Ard Biesheuvel <[email protected]>
> > > + default n
> >
> > 'default n' is the default so you can just remove the line
>
> Is this a guideline or just optional?
> Personally I like things to be explicit and if allowed I prefer to keep this line.

It's a common convention, and we have had patches in the past that
mass-removed those lines. I'd also just leave it out. It is generally well
understood that all options default to 'n' unless specified otherwise.

Arnd