From: Jonathan Cameron <jic23@kernel.org>
To: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Alexandru Ardelean <alexandru.ardelean@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: accel: mma8452: Constify static struct attribute_group
Date: Sat, 10 Oct 2020 18:05:49 +0100 [thread overview]
Message-ID: <20201010180549.629f8102@archlinux> (raw)
In-Reply-To: <20200930232939.31131-1-rikard.falkeborn@gmail.com>
On Thu, 1 Oct 2020 01:29:39 +0200
Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> The only usage of mma8452_event_attribute_group is to assign its address
> to the event_attrs field in the iio_info struct, which is a const
> pointer. Make it const to allow the compiler to put it in read-only
> memory. This was the only non-const static struct in drivers/iio.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
applied.
Thanks,
Jonathan
> ---
> drivers/iio/accel/mma8452.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index bf1d2c8afdbd..b0176d936423 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1187,7 +1187,7 @@ static struct attribute *mma8452_event_attributes[] = {
> NULL,
> };
>
> -static struct attribute_group mma8452_event_attribute_group = {
> +static const struct attribute_group mma8452_event_attribute_group = {
> .attrs = mma8452_event_attributes,
> };
>
prev parent reply other threads:[~2020-10-10 23:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 23:29 [PATCH] iio: accel: mma8452: Constify static struct attribute_group Rikard Falkeborn
2020-10-10 17:05 ` Jonathan Cameron [this message]
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=20201010180549.629f8102@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--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).