Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250313-sysfs-const-bin_attr-final-v2-2-96284e1e88ce@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thomas Weißschuh and committed by
Greg Kroah-Hartman
9bec9445 97d06802

+4 -4
+3 -3
fs/sysfs/group.c
··· 21 21 const struct attribute_group *grp) 22 22 { 23 23 struct attribute *const *attr; 24 - struct bin_attribute *const *bin_attr; 24 + const struct bin_attribute *const *bin_attr; 25 25 26 26 if (grp->attrs) 27 27 for (attr = grp->attrs; *attr; attr++) ··· 47 47 const struct attribute_group *grp, int update) 48 48 { 49 49 struct attribute *const *attr; 50 - struct bin_attribute *const *bin_attr; 50 + const struct bin_attribute *const *bin_attr; 51 51 int error = 0, i; 52 52 53 53 if (grp->attrs) { ··· 521 521 } 522 522 523 523 if (grp->bin_attrs) { 524 - struct bin_attribute *const *bin_attr; 524 + const struct bin_attribute *const *bin_attr; 525 525 526 526 for (bin_attr = grp->bin_attrs; *bin_attr; bin_attr++) { 527 527 kn = kernfs_find_and_get(grp_kn, (*bin_attr)->attr.name);
+1 -1
include/linux/sysfs.h
··· 107 107 int); 108 108 struct attribute **attrs; 109 109 union { 110 - struct bin_attribute **bin_attrs; 110 + const struct bin_attribute *const *bin_attrs; 111 111 const struct bin_attribute *const *bin_attrs_new; 112 112 }; 113 113 };