Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christophe JAILLET and committed by
Jonathan Cameron
d09ba52b d63d868b

+2 -2
+1 -1
drivers/iio/industrialio-sw-device.c
··· 148 148 config_item_put(item); 149 149 } 150 150 151 - static struct configfs_group_operations device_ops = { 151 + static const struct configfs_group_operations device_ops = { 152 152 .make_group = &device_make_group, 153 153 .drop_item = &device_drop_group, 154 154 };
+1 -1
drivers/iio/industrialio-sw-trigger.c
··· 152 152 config_item_put(item); 153 153 } 154 154 155 - static struct configfs_group_operations trigger_ops = { 155 + static const struct configfs_group_operations trigger_ops = { 156 156 .make_group = &trigger_make_group, 157 157 .drop_item = &trigger_drop_group, 158 158 };