History

sysfs: treewide: switch back to attribute_group::bin_attrs

The normal bin_attrs field can now handle const pointers. This makes the _new variant unnecessary. Switch all users back.

Thomas Weißschuh committed 1 year ago

Commit fb506e31 parent 2fbe82071 files · +91 −91Browse files

Showing the changes to kernel/module (1 of 71 files). Show all

Unified · Split

kernel/module/sysfs.c+5−5
@@ -56,9 +56,9 @@ static void free_sect_attrs(struct module_sect_attrs *sect_attrs) · 55 unmodified lines
56{56{
57 const struct bin_attribute *const *bin_attr;57 const struct bin_attribute *const *bin_attr;
58 58
59 for (bin_attr = sect_attrs->grp.bin_attrs_new; *bin_attr; bin_attr++)59 for (bin_attr = sect_attrs->grp.bin_attrs; *bin_attr; bin_attr++)
60 kfree((*bin_attr)->attr.name);60 kfree((*bin_attr)->attr.name);
61 kfree(sect_attrs->grp.bin_attrs_new);61 kfree(sect_attrs->grp.bin_attrs);
62 kfree(sect_attrs);62 kfree(sect_attrs);
63}63}
64 64
@@ -86,7 +86,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) · 21 unmodified lines
86 86
87 /* Setup section attributes. */87 /* Setup section attributes. */
88 sect_attrs->grp.name = "sections";88 sect_attrs->grp.name = "sections";
89 sect_attrs->grp.bin_attrs_new = gattr;89 sect_attrs->grp.bin_attrs = gattr;
90 90
91 sattr = &sect_attrs->attrs[0];91 sattr = &sect_attrs->attrs[0];
92 for (i = 0; i < info->hdr->e_shnum; i++) {92 for (i = 0; i < info->hdr->e_shnum; i++) {
@@ -144,7 +144,7 @@ struct module_notes_attrs { · 51 unmodified lines
144 144
145static void free_notes_attrs(struct module_notes_attrs *notes_attrs)145static void free_notes_attrs(struct module_notes_attrs *notes_attrs)
146{146{
147 kfree(notes_attrs->grp.bin_attrs_new);147 kfree(notes_attrs->grp.bin_attrs);
148 kfree(notes_attrs);148 kfree(notes_attrs);
149}149}
150 150
@@ -178,7 +178,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) · 27 unmodified lines
178 }178 }
179 179
180 notes_attrs->grp.name = "notes";180 notes_attrs->grp.name = "notes";
181 notes_attrs->grp.bin_attrs_new = gattr;181 notes_attrs->grp.bin_attrs = gattr;
182 182
183 nattr = &notes_attrs->attrs[0];183 nattr = &notes_attrs->attrs[0];
184 for (loaded = i = 0; i < info->hdr->e_shnum; ++i) {184 for (loaded = i = 0; i < info->hdr->e_shnum; ++i) {