]> git.ipfire.org Git - thirdparty/linux.git/commit
samples: configfs: Constify struct configfs_item_operations and configfs_group_operations
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 29 Dec 2025 11:23:51 +0000 (12:23 +0100)
committerAndreas Hindborg <a.hindborg@kernel.org>
Thu, 15 Jan 2026 08:27:27 +0000 (09:27 +0100)
commit6363844fdbbb76afe1d44d678fe0746390204a5f
treecec7813bb323c17742180032fcfc695fd872752d
parent1d40cb05e077bb294f128c6a52630b93e452a8ed
samples: configfs: 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
   7507    6504      64   14075    36fb samples/configfs/configfs_sample.o

After:
=====
   text    data     bss     dec     hex filename
   7827    6184      64   14075    36fb samples/configfs/configfs_sample.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/70c5fd68fcc4d3ba1f18002012fae19acf4ce50b.1767007414.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
samples/configfs/configfs_sample.c