@@ -26,7 +26,7 @@ struct module_sect_attrs {
2626
2727#define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4 ))
2828static ssize_t module_sect_read (struct file * file , struct kobject * kobj ,
29- struct bin_attribute * battr ,
29+ const struct bin_attribute * battr ,
3030 char * buf , loff_t pos , size_t count )
3131{
3232 char bounce [MODULE_SECT_READ_SIZE + 1 ];
@@ -54,18 +54,18 @@ static ssize_t module_sect_read(struct file *file, struct kobject *kobj,
5454
5555static void free_sect_attrs (struct module_sect_attrs * sect_attrs )
5656{
57- struct bin_attribute * * bin_attr ;
57+ const struct bin_attribute * const * bin_attr ;
5858
59- for (bin_attr = sect_attrs -> grp .bin_attrs ; * bin_attr ; bin_attr ++ )
59+ for (bin_attr = sect_attrs -> grp .bin_attrs_new ; * bin_attr ; bin_attr ++ )
6060 kfree ((* bin_attr )-> attr .name );
61- kfree (sect_attrs -> grp .bin_attrs );
61+ kfree (sect_attrs -> grp .bin_attrs_new );
6262 kfree (sect_attrs );
6363}
6464
6565static int add_sect_attrs (struct module * mod , const struct load_info * info )
6666{
6767 struct module_sect_attrs * sect_attrs ;
68- struct bin_attribute * * gattr ;
68+ const struct bin_attribute * * gattr ;
6969 struct bin_attribute * sattr ;
7070 unsigned int nloaded = 0 , i ;
7171 int ret ;
@@ -86,7 +86,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info)
8686
8787 /* Setup section attributes. */
8888 sect_attrs -> grp .name = "sections" ;
89- sect_attrs -> grp .bin_attrs = gattr ;
89+ sect_attrs -> grp .bin_attrs_new = gattr ;
9090
9191 sattr = & sect_attrs -> attrs [0 ];
9292 for (i = 0 ; i < info -> hdr -> e_shnum ; i ++ ) {
@@ -101,7 +101,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info)
101101 ret = - ENOMEM ;
102102 goto out ;
103103 }
104- sattr -> read = module_sect_read ;
104+ sattr -> read_new = module_sect_read ;
105105 sattr -> private = (void * )sec -> sh_addr ;
106106 sattr -> size = MODULE_SECT_READ_SIZE ;
107107 sattr -> attr .mode = 0400 ;
@@ -144,15 +144,15 @@ struct module_notes_attrs {
144144
145145static void free_notes_attrs (struct module_notes_attrs * notes_attrs )
146146{
147- kfree (notes_attrs -> grp .bin_attrs );
147+ kfree (notes_attrs -> grp .bin_attrs_new );
148148 kfree (notes_attrs );
149149}
150150
151151static int add_notes_attrs (struct module * mod , const struct load_info * info )
152152{
153153 unsigned int notes , loaded , i ;
154154 struct module_notes_attrs * notes_attrs ;
155- struct bin_attribute * * gattr ;
155+ const struct bin_attribute * * gattr ;
156156 struct bin_attribute * nattr ;
157157 int ret ;
158158
@@ -178,7 +178,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info)
178178 }
179179
180180 notes_attrs -> grp .name = "notes" ;
181- notes_attrs -> grp .bin_attrs = gattr ;
181+ notes_attrs -> grp .bin_attrs_new = gattr ;
182182
183183 nattr = & notes_attrs -> attrs [0 ];
184184 for (loaded = i = 0 ; i < info -> hdr -> e_shnum ; ++ i ) {
0 commit comments