]> Gentwo Git Trees - linux/.git/commitdiff
configfs: Constify ct_group_ops in struct config_item_type
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 25 Oct 2025 11:15:37 +0000 (13:15 +0200)
committerAndreas Hindborg <a.hindborg@kernel.org>
Thu, 27 Nov 2025 11:03:27 +0000 (12:03 +0100)
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>
fs/configfs/dir.c
include/linux/configfs.h

index 81f4f06bc87e755c1c7d3ddc25c4bc3581577dc8..4bcd14b3434c3a4955d4c97ba83ceb4c484803e9 100644 (file)
@@ -598,7 +598,7 @@ static void detach_attrs(struct config_item * item)
 static int populate_attrs(struct config_item *item)
 {
        const struct config_item_type *t = item->ci_type;
-       struct configfs_group_operations *ops;
+       const struct configfs_group_operations *ops;
        struct configfs_attribute *attr;
        struct configfs_bin_attribute *bin_attr;
        int error = 0;
index 698520b1bfdbc3437fd467b82accd8eac1672bc0..31a7d7124460bcee1df0dddc325d41d8511cb5c3 100644 (file)
@@ -65,7 +65,7 @@ extern void config_item_put(struct config_item *);
 struct config_item_type {
        struct module                           *ct_owner;
        struct configfs_item_operations         *ct_item_ops;
-       struct configfs_group_operations        *ct_group_ops;
+       const struct configfs_group_operations  *ct_group_ops;
        struct configfs_attribute               **ct_attrs;
        struct configfs_bin_attribute           **ct_bin_attrs;
 };