File tree 1 file changed +4
-17
lines changed
1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -239,21 +239,7 @@ extern const void __start_notes;
239
239
extern const void __stop_notes ;
240
240
#define notes_size (&__stop_notes - &__start_notes)
241
241
242
- static ssize_t notes_read (struct file * filp , struct kobject * kobj ,
243
- struct bin_attribute * bin_attr ,
244
- char * buf , loff_t off , size_t count )
245
- {
246
- memcpy (buf , & __start_notes + off , count );
247
- return count ;
248
- }
249
-
250
- static struct bin_attribute notes_attr __ro_after_init = {
251
- .attr = {
252
- .name = "notes" ,
253
- .mode = S_IRUGO ,
254
- },
255
- .read = & notes_read ,
256
- };
242
+ static __ro_after_init BIN_ATTR_SIMPLE_RO (notes );
257
243
258
244
struct kobject * kernel_kobj ;
259
245
EXPORT_SYMBOL_GPL (kernel_kobj );
@@ -307,8 +293,9 @@ static int __init ksysfs_init(void)
307
293
goto kset_exit ;
308
294
309
295
if (notes_size > 0 ) {
310
- notes_attr .size = notes_size ;
311
- error = sysfs_create_bin_file (kernel_kobj , & notes_attr );
296
+ bin_attr_notes .private = (void * )& __start_notes ;
297
+ bin_attr_notes .size = notes_size ;
298
+ error = sysfs_create_bin_file (kernel_kobj , & bin_attr_notes );
312
299
if (error )
313
300
goto group_exit ;
314
301
}
You can’t perform that action at this time.
0 commit comments