All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/swap_state: Constify static struct attribute_group
Date: Tue, 02 Feb 2021 08:39:25 +0800	[thread overview]
Message-ID: <8735yfl2v6.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20210201233254.91809-1-rikard.falkeborn@gmail.com> (Rikard Falkeborn's message of "Tue, 2 Feb 2021 00:32:54 +0100")

Rikard Falkeborn <rikard.falkeborn@gmail.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@gmail.com>

Looks good to me.

Acked-by: "Huang, Ying" <ying.huang@intel.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,
>  };


  parent reply	other threads:[~2021-02-02  0:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 23:32 [PATCH] mm/swap_state: Constify static struct attribute_group Rikard Falkeborn
2021-02-01 23:54 ` Amy Parker
2021-02-02  0:39 ` Huang, Ying [this message]
2021-02-02  1:35 ` Miaohe Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735yfl2v6.fsf@yhuang-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rikard.falkeborn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.