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

configfs: Constify ct_group_ops in struct config_item_type

Make 'ct_group_ops' const in struct config_item_type.
This allows constification of many structures which hold some function
pointers.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/6b720cf407e8a6d30f35beb72e031b2553d1ab7e.1761390472.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>

authored by

Christophe JAILLET and committed by
Andreas Hindborg
f2f36500 ac3fd01e

+2 -2
+1 -1
fs/configfs/dir.c
··· 598 598 static int populate_attrs(struct config_item *item) 599 599 { 600 600 const struct config_item_type *t = item->ci_type; 601 - struct configfs_group_operations *ops; 601 + const struct configfs_group_operations *ops; 602 602 struct configfs_attribute *attr; 603 603 struct configfs_bin_attribute *bin_attr; 604 604 int error = 0;
+1 -1
include/linux/configfs.h
··· 65 65 struct config_item_type { 66 66 struct module *ct_owner; 67 67 struct configfs_item_operations *ct_item_ops; 68 - struct configfs_group_operations *ct_group_ops; 68 + const struct configfs_group_operations *ct_group_ops; 69 69 struct configfs_attribute **ct_attrs; 70 70 struct configfs_bin_attribute **ct_bin_attrs; 71 71 };