History

module: sysfs: Drop 'struct module_sect_attr'

This is now an otherwise empty wrapper around a 'struct bin_attribute', not providing any functionality. Remove it.

Thomas Weißschuh committed 1 year ago

Commit 34f5ec01 parent 4b2c11e1 file · +11 −15Browse files

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

Unified · Split

kernel/module/sysfs.c+11−15
@@ -19,13 +19,9 @@ · 18 unmodified lines
1919 * J. Corbet <corbet@lwn.net>
2020 */
2121 #ifdef CONFIG_KALLSYMS
22−struct module_sect_attr {
23− struct bin_attribute battr;
24−};
25−
2622 struct module_sect_attrs {
2723 struct attribute_group grp;
28− struct module_sect_attr attrs[];
24+ struct bin_attribute attrs[];
2925 };
3026
3127 #define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4))
@@ -69,8 +65,8 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) · 37 unmodified lines
6965 {
7066 unsigned int nloaded = 0, i, size[2];
7167 struct module_sect_attrs *sect_attrs;
72− struct module_sect_attr *sattr;
7368 struct bin_attribute **gattr;
69+ struct bin_attribute *sattr;
7470 int ret;
7571
7672 /* Count loaded sections and allocate structures */
@@ -95,18 +91,18 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) · 18 unmodified lines
9591
9692 if (sect_empty(sec))
9793 continue;
98− sysfs_bin_attr_init(&sattr->battr);
99− sattr->battr.attr.name =
94+ sysfs_bin_attr_init(sattr);
95+ sattr->attr.name =
10096 kstrdup(info->secstrings + sec->sh_name, GFP_KERNEL);
101− if (!sattr->battr.attr.name) {
97+ if (!sattr->attr.name) {
10298 ret = -ENOMEM;
10399 goto out;
104100 }
105− sattr->battr.read = module_sect_read;
106− sattr->battr.private = (void *)sec->sh_addr;
107− sattr->battr.size = MODULE_SECT_READ_SIZE;
108− sattr->battr.attr.mode = 0400;
109− *(gattr++) = &(sattr++)->battr;
101+ sattr->read = module_sect_read;
102+ sattr->private = (void *)sec->sh_addr;
103+ sattr->size = MODULE_SECT_READ_SIZE;
104+ sattr->attr.mode = 0400;
105+ *(gattr++) = sattr++;
110106 }
111107 *gattr = NULL;
112108
@@ -186,7 +182,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) · 73 unmodified lines
186182 continue;
187183 if (info->sechdrs[i].sh_type == SHT_NOTE) {
188184 sysfs_bin_attr_init(nattr);
189− nattr->attr.name = mod->sect_attrs->attrs[loaded].battr.attr.name;
185+ nattr->attr.name = mod->sect_attrs->attrs[loaded].attr.name;
190186 nattr->attr.mode = 0444;
191187 nattr->size = info->sechdrs[i].sh_size;
192188 nattr->private = (void *)info->sechdrs[i].sh_addr;