linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Wu Hao <hao.wu@intel.com>, Moritz Fischer <mdf@kernel.org>
Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fpga: dfl: fme: Constify static attribute_group structs
Date: Sat, 9 Jan 2021 13:55:13 -0800	[thread overview]
Message-ID: <a1c87050-0962-5169-8ed4-c1da0098ff34@redhat.com> (raw)
In-Reply-To: <20210108235414.48017-1-rikard.falkeborn@gmail.com>


On 1/8/21 3:54 PM, Rikard Falkeborn wrote:
> The only usage of these is to put their addresses in arrays of pointers
> to const attribute_groups. Make them const to allow the compiler to put
> them in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
>  drivers/fpga/dfl-fme-perf.c | 6 +++---

This looks ok.

There are other 'static struct's in drivers/fpga.

Why is the change limited to this file ?

Tom

>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/fpga/dfl-fme-perf.c b/drivers/fpga/dfl-fme-perf.c
> index 531266287eee..4299145ef347 100644
> --- a/drivers/fpga/dfl-fme-perf.c
> +++ b/drivers/fpga/dfl-fme-perf.c
> @@ -192,7 +192,7 @@ static struct attribute *fme_perf_cpumask_attrs[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group fme_perf_cpumask_group = {
> +static const struct attribute_group fme_perf_cpumask_group = {
>  	.attrs = fme_perf_cpumask_attrs,
>  };
>  
> @@ -225,7 +225,7 @@ static struct attribute *fme_perf_format_attrs[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group fme_perf_format_group = {
> +static const struct attribute_group fme_perf_format_group = {
>  	.name = "format",
>  	.attrs = fme_perf_format_attrs,
>  };
> @@ -239,7 +239,7 @@ static struct attribute *fme_perf_events_attrs_empty[] = {
>  	NULL,
>  };
>  
> -static struct attribute_group fme_perf_events_group = {
> +static const struct attribute_group fme_perf_events_group = {
>  	.name = "events",
>  	.attrs = fme_perf_events_attrs_empty,
>  };


  reply	other threads:[~2021-01-09 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 23:54 [PATCH] fpga: dfl: fme: Constify static attribute_group structs Rikard Falkeborn
2021-01-09 21:55 ` Tom Rix [this message]
2021-01-09 22:52   ` Rikard Falkeborn
2021-01-10  1:40     ` Tom Rix
2021-01-10 19:06       ` Moritz Fischer

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=a1c87050-0962-5169-8ed4-c1da0098ff34@redhat.com \
    --to=trix@redhat.com \
    --cc=hao.wu@intel.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).