This is now an otherwise empty wrapper around a 'struct bin_attribute', not providing any functionality. Remove it.
Showing the changes to kernel/module (1 of 1 file). Show all
Unified · Split
| @@ -19,13 +19,9 @@ · 18 unmodified lines | |||
| 19 | * J. Corbet <corbet@lwn.net> | 19 | * J. Corbet <corbet@lwn.net> |
| 20 | */ | 20 | */ |
| 21 | #ifdef CONFIG_KALLSYMS | 21 | #ifdef CONFIG_KALLSYMS |
| 22 | struct module_sect_attr { | ||
| 23 | struct bin_attribute battr; | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct module_sect_attrs { | 22 | struct module_sect_attrs { |
| 27 | struct attribute_group grp; | 23 | struct attribute_group grp; |
| 28 | struct module_sect_attr attrs[]; | 24 | struct bin_attribute attrs[]; |
| 29 | }; | 25 | }; |
| 30 | 26 | ||
| 31 | #define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4)) | 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 | unsigned int nloaded = 0, i, size[2]; | 66 | unsigned int nloaded = 0, i, size[2]; |
| 71 | struct module_sect_attrs *sect_attrs; | 67 | struct module_sect_attrs *sect_attrs; |
| 72 | struct module_sect_attr *sattr; | ||
| 73 | struct bin_attribute **gattr; | 68 | struct bin_attribute **gattr; |
| 69 | struct bin_attribute *sattr; | ||
| 74 | int ret; | 70 | int ret; |
| 75 | 71 | ||
| 76 | /* Count loaded sections and allocate structures */ | 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 | if (sect_empty(sec)) | 92 | if (sect_empty(sec)) |
| 97 | continue; | 93 | continue; |
| 98 | sysfs_bin_attr_init(&sattr->battr); | 94 | sysfs_bin_attr_init(sattr); |
| 99 | sattr->battr.attr.name = | 95 | sattr->attr.name = |
| 100 | kstrdup(info->secstrings + sec->sh_name, GFP_KERNEL); | 96 | kstrdup(info->secstrings + sec->sh_name, GFP_KERNEL); |
| 101 | if (!sattr->battr.attr.name) { | 97 | if (!sattr->attr.name) { |
| 102 | ret = -ENOMEM; | 98 | ret = -ENOMEM; |
| 103 | goto out; | 99 | goto out; |
| 104 | } | 100 | } |
| 105 | sattr->battr.read = module_sect_read; | 101 | sattr->read = module_sect_read; |
| 106 | sattr->battr.private = (void *)sec->sh_addr; | 102 | sattr->private = (void *)sec->sh_addr; |
| 107 | sattr->battr.size = MODULE_SECT_READ_SIZE; | 103 | sattr->size = MODULE_SECT_READ_SIZE; |
| 108 | sattr->battr.attr.mode = 0400; | 104 | sattr->attr.mode = 0400; |
| 109 | *(gattr++) = &(sattr++)->battr; | 105 | *(gattr++) = sattr++; |
| 110 | } | 106 | } |
| 111 | *gattr = NULL; | 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 | continue; | 182 | continue; |
| 187 | if (info->sechdrs[i].sh_type == SHT_NOTE) { | 183 | if (info->sechdrs[i].sh_type == SHT_NOTE) { |
| 188 | sysfs_bin_attr_init(nattr); | 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 | nattr->attr.mode = 0444; | 186 | nattr->attr.mode = 0444; |
| 191 | nattr->size = info->sechdrs[i].sh_size; | 187 | nattr->size = info->sechdrs[i].sh_size; |
| 192 | nattr->private = (void *)info->sechdrs[i].sh_addr; | 188 | nattr->private = (void *)info->sechdrs[i].sh_addr; |