From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org, Tim Harvey <tharvey@gateworks.com>,
Robert Jones <rjones@gateworks.com>,
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [RESEND PATCH 1/3] mfd: gateworks-gsc: Constify static struct attribute_group
Date: Tue, 2 Mar 2021 22:05:26 +0100 [thread overview]
Message-ID: <20210302210528.70945-2-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20210302210528.70945-1-rikard.falkeborn@gmail.com>
The only usage of attr_group is to pass its address to
sysfs_create_group() and sysfs_remove_group(), both which takes pointers
to const attribute_group structs. Make it const to allow the compiler to
put it in read-only memory.
Done with the help of coccinelle.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/mfd/gateworks-gsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/gateworks-gsc.c b/drivers/mfd/gateworks-gsc.c
index d87876747b91..8745f9d8c26f 100644
--- a/drivers/mfd/gateworks-gsc.c
+++ b/drivers/mfd/gateworks-gsc.c
@@ -150,7 +150,7 @@ static struct attribute *gsc_attrs[] = {
NULL,
};
-static struct attribute_group attr_group = {
+static const struct attribute_group attr_group = {
.attrs = gsc_attrs,
};
--
2.30.1
next prev parent reply other threads:[~2021-03-02 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 21:05 [RESEND PATCH 0/3] drivers/mfd: Constify static attribute_group structs Rikard Falkeborn
2021-03-02 21:05 ` Rikard Falkeborn [this message]
2021-03-02 21:05 ` [RESEND PATCH 2/3] mfd: lm3533: Constify static struct attribute_group Rikard Falkeborn
2021-03-02 21:05 ` [RESEND PATCH 3/3] mfd: pcf50633: " Rikard Falkeborn
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=20210302210528.70945-2-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjones@gateworks.com \
--cc=tharvey@gateworks.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).