Skip to content

Commit 9bec944

Browse files
t-8chgregkh
authored andcommitted
sysfs: constify attribute_group::bin_attrs
All users of this field have been migrated to bin_attrs_new. It can now be constified. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/20250313-sysfs-const-bin_attr-final-v2-2-96284e1e88ce@weissschuh.net Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 97d0680 commit 9bec944

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fs/sysfs/group.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void remove_files(struct kernfs_node *parent,
2121
const struct attribute_group *grp)
2222
{
2323
struct attribute *const *attr;
24-
struct bin_attribute *const *bin_attr;
24+
const struct bin_attribute *const *bin_attr;
2525

2626
if (grp->attrs)
2727
for (attr = grp->attrs; *attr; attr++)
@@ -47,7 +47,7 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj,
4747
const struct attribute_group *grp, int update)
4848
{
4949
struct attribute *const *attr;
50-
struct bin_attribute *const *bin_attr;
50+
const struct bin_attribute *const *bin_attr;
5151
int error = 0, i;
5252

5353
if (grp->attrs) {
@@ -521,7 +521,7 @@ static int sysfs_group_attrs_change_owner(struct kernfs_node *grp_kn,
521521
}
522522

523523
if (grp->bin_attrs) {
524-
struct bin_attribute *const *bin_attr;
524+
const struct bin_attribute *const *bin_attr;
525525

526526
for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) {
527527
kn = kernfs_find_and_get(grp_kn, (*bin_attr)->attr.name);

include/linux/sysfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct attribute_group {
107107
int);
108108
struct attribute **attrs;
109109
union {
110-
struct bin_attribute **bin_attrs;
110+
const struct bin_attribute *const *bin_attrs;
111111
const struct bin_attribute *const *bin_attrs_new;
112112
};
113113
};

0 commit comments

Comments
 (0)