From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: YueHaibing <yuehaibing@huawei.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH] Input: atkbd - constify static struct attribute_group
Date: Wed, 28 Jul 2021 19:53:03 +0200 [thread overview]
Message-ID: <20210728175303.245038-1-rikard.falkeborn@gmail.com> (raw)
The struct atkbd_attribute_group is only used by passing its address to
sysfs_create_group() and sysfs_remove_group(), both which takes pointers
to const struct 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>
---
drivers/input/keyboard/atkbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index fbdef95291e9..c96e4dcb43d8 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -335,7 +335,7 @@ static umode_t atkbd_attr_is_visible(struct kobject *kobj,
return attr->mode;
}
-static struct attribute_group atkbd_attribute_group = {
+static const struct attribute_group atkbd_attribute_group = {
.attrs = atkbd_attributes,
.is_visible = atkbd_attr_is_visible,
};
--
2.32.0
reply other threads:[~2021-07-28 17:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210728175303.245038-1-rikard.falkeborn@gmail.com \
--to=rikard.falkeborn@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yuehaibing@huawei.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).