]> Gentwo Git Trees - linux/.git/commitdiff
configfs: Constify ct_item_ops in struct config_item_type
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 25 Oct 2025 11:15:38 +0000 (13:15 +0200)
committerAndreas Hindborg <a.hindborg@kernel.org>
Thu, 27 Nov 2025 11:03:27 +0000 (12:03 +0100)
Make 'ct_item_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/f43cb57418a7f59e883be8eedc7d6abe802a2094.1761390472.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
fs/configfs/file.c
include/linux/configfs.h

index 0ad32150611ea6b26e7e7d1b36cec87d3a79758d..affe4742bbb53bb1c29f3ac68e37bb3bc269a4c3 100644 (file)
@@ -30,7 +30,7 @@ struct configfs_buffer {
        size_t                  count;
        loff_t                  pos;
        char                    * page;
-       struct configfs_item_operations * ops;
+       const struct configfs_item_operations   *ops;
        struct mutex            mutex;
        int                     needs_read_fill;
        bool                    read_in_progress;
index 31a7d7124460bcee1df0dddc325d41d8511cb5c3..ef65c75beeaad87d33a18e86ac47bf2994705f2e 100644 (file)
@@ -64,7 +64,7 @@ extern void config_item_put(struct config_item *);
 
 struct config_item_type {
        struct module                           *ct_owner;
-       struct configfs_item_operations         *ct_item_ops;
+       const struct configfs_item_operations   *ct_item_ops;
        const struct configfs_group_operations  *ct_group_ops;
        struct configfs_attribute               **ct_attrs;
        struct configfs_bin_attribute           **ct_bin_attrs;