This is now an otherwise empty wrapper around a 'struct bin_attribute', not providing any functionality. Remove it.
Unified · Split
| @@ -19,13 +19,9 @@ · 18 unmodified lines | ||
| 19 | 19 | * J. Corbet <corbet@lwn.net> |
| 20 | 20 | */ |
| 21 | 21 | #ifdef CONFIG_KALLSYMS |
| 22 | −struct module_sect_attr { | |
| 23 | − struct bin_attribute battr; | |
| 24 | −}; | |
| 25 | − | |
| 26 | 22 | struct module_sect_attrs { |
| 27 | 23 | struct attribute_group grp; |
| 28 | − struct module_sect_attr attrs[]; | |
| 24 | + struct bin_attribute attrs[]; | |
| 29 | 25 | }; |
| 30 | 26 | |
| 31 | 27 | #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 | ||
| 69 | 65 | { |
| 70 | 66 | unsigned int nloaded = 0, i, size[2]; |
| 71 | 67 | struct module_sect_attrs *sect_attrs; |
| 72 | − struct module_sect_attr *sattr; | |
| 73 | 68 | struct bin_attribute **gattr; |
| 69 | + struct bin_attribute *sattr; | |
| 74 | 70 | int ret; |
| 75 | 71 | |
| 76 | 72 | /* 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 | ||
| 95 | 91 | |
| 96 | 92 | if (sect_empty(sec)) |
| 97 | 93 | continue; |
| 98 | − sysfs_bin_attr_init(&sattr->battr); | |
| 99 | − sattr->battr.attr.name = | |
| 94 | + sysfs_bin_attr_init(sattr); | |
| 95 | + sattr->attr.name = | |
| 100 | 96 | kstrdup(info->secstrings + sec->sh_name, GFP_KERNEL); |
| 101 | − if (!sattr->battr.attr.name) { | |
| 97 | + if (!sattr->attr.name) { | |
| 102 | 98 | ret = -ENOMEM; |
| 103 | 99 | goto out; |
| 104 | 100 | } |
| 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++; | |
| 110 | 106 | } |
| 111 | 107 | *gattr = NULL; |
| 112 | 108 | |
| @@ -186,7 +182,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) · 73 unmodified lines | ||
| 186 | 182 | continue; |
| 187 | 183 | if (info->sechdrs[i].sh_type == SHT_NOTE) { |
| 188 | 184 | 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; | |
| 190 | 186 | nattr->attr.mode = 0444; |
| 191 | 187 | nattr->size = info->sechdrs[i].sh_size; |
| 192 | 188 | nattr->private = (void *)info->sechdrs[i].sh_addr; |