mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
iio: core: Constify struct configfs_item_operations and configfs_group_operations
'struct configfs_item_operations' and 'configfs_group_operations' are not modified in this driver. Constifying these structures moves some data to a read-only section, so increases overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 5037 1528 64 6629 19e5 drivers/iio/industrialio-sw-device.o 5509 1528 64 7101 1bbd drivers/iio/industrialio-sw-trigger.o After: ===== text data bss dec hex filename 5133 1432 64 6629 19e5 drivers/iio/industrialio-sw-device.o 5605 1432 64 7101 1bbd drivers/iio/industrialio-sw-trigger.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
d63d868b31
commit
d09ba52bfb
2 changed files with 2 additions and 2 deletions
|
|
@ -148,7 +148,7 @@ static void device_drop_group(struct config_group *group,
|
|||
config_item_put(item);
|
||||
}
|
||||
|
||||
static struct configfs_group_operations device_ops = {
|
||||
static const struct configfs_group_operations device_ops = {
|
||||
.make_group = &device_make_group,
|
||||
.drop_item = &device_drop_group,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static void trigger_drop_group(struct config_group *group,
|
|||
config_item_put(item);
|
||||
}
|
||||
|
||||
static struct configfs_group_operations trigger_ops = {
|
||||
static const struct configfs_group_operations trigger_ops = {
|
||||
.make_group = &trigger_make_group,
|
||||
.drop_item = &trigger_drop_group,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue