From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>
Cc: linux-kernel@vger.kernel.org, "Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH v2 2/6] sysfs: constify attribute_group::bin_attrs
Date: Thu, 13 Mar 2025 16:57:46 +0100 [thread overview]
Message-ID: <20250313-sysfs-const-bin_attr-final-v2-2-96284e1e88ce@weissschuh.net> (raw)
In-Reply-To: <20250313-sysfs-const-bin_attr-final-v2-0-96284e1e88ce@weissschuh.net>
All users of this field have been migrated to bin_attrs_new.
It can now be constified.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
fs/sysfs/group.c | 6 +++---
include/linux/sysfs.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index 8b01a7eda5fb3239e138372417d01967c7a3f122..2d78e94072a0d4ed957560c60cc3c5dd49ab6fb4 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -21,7 +21,7 @@ static void remove_files(struct kernfs_node *parent,
const struct attribute_group *grp)
{
struct attribute *const *attr;
- struct bin_attribute *const *bin_attr;
+ const struct bin_attribute *const *bin_attr;
if (grp->attrs)
for (attr = grp->attrs; *attr; attr++)
@@ -47,7 +47,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
const struct attribute_group *grp, int update)
{
struct attribute *const *attr;
- struct bin_attribute *const *bin_attr;
+ const struct bin_attribute *const *bin_attr;
int error = 0, i;
if (grp->attrs) {
@@ -521,7 +521,7 @@ static int sysfs_group_attrs_change_owner(struct kernfs_node *grp_kn,
}
if (grp->bin_attrs) {
- struct bin_attribute *const *bin_attr;
+ const struct bin_attribute *const *bin_attr;
for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) {
kn = kernfs_find_and_get(grp_kn, (*bin_attr)->attr.name);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 576b8b3c60afb382e4ce18247fd5a3d50f08d579..f418aae4f1134f8126783d9e8eb575ba4278e927 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -107,7 +107,7 @@ struct attribute_group {
int);
struct attribute **attrs;
union {
- struct bin_attribute **bin_attrs;
+ const struct bin_attribute *const *bin_attrs;
const struct bin_attribute *const *bin_attrs_new;
};
};
--
2.48.1
next prev parent reply other threads:[~2025-03-13 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 15:57 [PATCH v2 0/6] sysfs: finalize the constification of 'struct bin_attribute' Thomas Weißschuh
2025-03-13 15:57 ` [PATCH v2 1/6] sysfs: constify bin_attribute argument of bin_attribute::read/write() Thomas Weißschuh
2025-03-13 15:57 ` Thomas Weißschuh [this message]
2025-03-13 15:57 ` [PATCH v2 3/6] sysfs: treewide: switch back to bin_attribute::read()/write() Thomas Weißschuh
2025-03-13 15:57 ` [PATCH v2 4/6] sysfs: treewide: switch back to attribute_group::bin_attrs Thomas Weißschuh
2025-03-13 15:57 ` [PATCH v2 5/6] sysfs: remove bin_attribute::read_new/write_new() Thomas Weißschuh
2025-03-13 15:57 ` [PATCH v2 6/6] sysfs: remove attribute_group::bin_attrs_new Thomas Weißschuh
2025-04-15 16:48 ` [PATCH v2 0/6] sysfs: finalize the constification of 'struct bin_attribute' Greg Kroah-Hartman
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=20250313-sysfs-const-bin_attr-final-v2-2-96284e1e88ce@weissschuh.net \
--to=linux@weissschuh.net \
--cc=dakr@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/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
all inboxes | Powered by JetHome®