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
5656 {
5757 const struct bin_attribute *const *bin_attr;
5858
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++)
6060 kfree((*bin_attr)->attr.name);
61− kfree(sect_attrs->grp.bin_attrs_new);
61+ kfree(sect_attrs->grp.bin_attrs);
6262 kfree(sect_attrs);
6363 }
6464
@@ -86,7 +86,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) · 21 unmodified lines
8686
8787 /* Setup section attributes. */
8888 sect_attrs->grp.name = "sections";
89− sect_attrs->grp.bin_attrs_new = gattr;
89+ sect_attrs->grp.bin_attrs = gattr;
9090
9191 sattr = &sect_attrs->attrs[0];
9292 for (i = 0; i < info->hdr->e_shnum; i++) {
@@ -144,7 +144,7 @@ struct module_notes_attrs { · 51 unmodified lines
144144
145145 static void free_notes_attrs(struct module_notes_attrs *notes_attrs)
146146 {
147− kfree(notes_attrs->grp.bin_attrs_new);
147+ kfree(notes_attrs->grp.bin_attrs);
148148 kfree(notes_attrs);
149149 }
150150
@@ -178,7 +178,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) · 27 unmodified lines
178178 }
179179
180180 notes_attrs->grp.name = "notes";
181− notes_attrs->grp.bin_attrs_new = gattr;
181+ notes_attrs->grp.bin_attrs = gattr;
182182
183183 nattr = &notes_attrs->attrs[0];
184184 for (loaded = i = 0; i < info->hdr->e_shnum; ++i) {