The elevator_name field in struct elevator_type is declared as an array of characters (ELV_NAME_MAX size) but in practice used as a string pointer with its initialization done statically within each elevator elevator_type structure declaration. Change the declaration of elevator_name to the more appropriate "const char *" type.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -75,7 +75,7 @@ struct elevator_type · 74 unmodified lines | |||
| 75 | size_t icq_size; /* see iocontext.h */ | 75 | size_t icq_size; /* see iocontext.h */ |
| 76 | size_t icq_align; /* ditto */ | 76 | size_t icq_align; /* ditto */ |
| 77 | struct elv_fs_entry *elevator_attrs; | 77 | struct elv_fs_entry *elevator_attrs; |
| 78 | char elevator_name[ELV_NAME_MAX]; | 78 | const char *elevator_name; |
| 79 | const char *elevator_alias; | 79 | const char *elevator_alias; |
| 80 | struct module *elevator_owner; | 80 | struct module *elevator_owner; |
| 81 | #ifdef CONFIG_BLK_DEBUG_FS | 81 | #ifdef CONFIG_BLK_DEBUG_FS |