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:   Tue, 02 Feb 2021 08:39:25 +0800
From:   "Huang, Ying" <ying.huang@...el.com>
To:     Rikard Falkeborn <rikard.falkeborn@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/swap_state: Constify static struct attribute_group

Rikard Falkeborn <rikard.falkeborn@...il.com> writes:

> The only usage of swap_attr_group is to pass its address to
> sysfs_create_group() which takes a pointer to const attribute_group.
> Make it const to allow the compiler to put it in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>

Looks good to me.

Acked-by: "Huang, Ying" <ying.huang@...el.com>

> ---
>  mm/swap_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/swap_state.c b/mm/swap_state.c
> index d0d417efeecc..3cdee7b11da9 100644
> --- a/mm/swap_state.c
> +++ b/mm/swap_state.c
> @@ -901,7 +901,7 @@ static struct attribute *swap_attrs[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group swap_attr_group = {
> +static const struct attribute_group swap_attr_group = {
>  	.attrs = swap_attrs,
>  };

Powered by blists - more mailing lists