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]
Date:   Thu, 2 Jul 2020 09:51:49 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Rikard Falkeborn <rikard.falkeborn@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Matt Mackall <mpm@...enic.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
        <linux-crypto@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/5] hwrng: nomadik - Constify nmk_rng_ids[]

On Wed, Jul 1, 2020 at 11:48 PM Rikard Falkeborn
<rikard.falkeborn@...il.com> wrote:
>
> nmk_rng_ids[] is not modified and can be made const to allow the
> compiler to put it in read-only memory.
>
> Before:
>    text    data     bss     dec     hex filename
>     652     216       4     872     368 drivers/char/hw_random/nomadik-rng.o
>
> After:
>    text    data     bss     dec     hex filename
>     676     192       4     872     368 drivers/char/hw_random/nomadik-rng.o

Moving 24 bytes into the .rodata section is probably not a worth
the change, but the patch is correct and I agree this should be
.rodata anway.

> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>

Acked-by: Arnd Bergmann <arnd@...db.de>

> ---
>  drivers/char/hw_random/nomadik-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/hw_random/nomadik-rng.c b/drivers/char/hw_random/nomadik-rng.c
> index 74ed29f42e4f..b0ded41eb865 100644
> --- a/drivers/char/hw_random/nomadik-rng.c
> +++ b/drivers/char/hw_random/nomadik-rng.c
> @@ -76,7 +76,7 @@ static int nmk_rng_remove(struct amba_device *dev)
>         return 0;
>  }
>
> -static struct amba_id nmk_rng_ids[] = {
> +static const struct amba_id nmk_rng_ids[] = {
>         {
>                 .id     = 0x000805e1,
>                 .mask   = 0x000fffff, /* top bits are rev and cfg: accept all */
> --
> 2.27.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ