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.

null_blk: 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
100263 37808 2752 140823 22617 drivers/block/null_blk/main.o

After:
=====
text data bss dec hex filename
100423 37648 2752 140823 22617 drivers/block/null_blk/main.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christophe JAILLET and committed by
Jens Axboe
9e371032 e1418af7

+2 -2
+2 -2
drivers/block/null_blk/main.c
··· 642 642 null_free_dev(dev); 643 643 } 644 644 645 - static struct configfs_item_operations nullb_device_ops = { 645 + static const struct configfs_item_operations nullb_device_ops = { 646 646 .release = nullb_device_release, 647 647 }; 648 648 ··· 739 739 NULL, 740 740 }; 741 741 742 - static struct configfs_group_operations nullb_group_ops = { 742 + static const struct configfs_group_operations nullb_group_ops = { 743 743 .make_group = nullb_group_make_group, 744 744 .drop_item = nullb_group_drop_item, 745 745 };