From aa293583f0fe8b1634aeadbea06b4d0d04c30a95 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 16 Oct 2017 17:18:40 +0200 Subject: configfs: make ci_type field, some pointers and function arguments const The ci_type field of the config_item structure do not modify the fields of the config_item_type structure it points to. And the other pointers initialized with ci_type do not modify the fields as well. So, make the ci_type field and the pointers initialized with ci_type as const. Make the struct config_item_type *type function argument of functions config_{item/group}_init_type_name const as the argument in both the functions is only stored in the ci_type field of a config_item structure which is now made const. Make the argument of configfs_register_default_group const as it is only passed to the argument of the function config_group_init_type_name which is now const. Signed-off-by: Bhumika Goyal Acked-by: Greg Kroah-Hartman Signed-off-by: Christoph Hellwig --- fs/configfs/symlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/configfs/symlink.c') diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index c8aabba502f6..78ffc2699993 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c @@ -138,7 +138,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna struct configfs_dirent *sd; struct config_item *parent_item; struct config_item *target_item = NULL; - struct config_item_type *type; + const struct config_item_type *type; sd = dentry->d_parent->d_fsdata; /* @@ -186,7 +186,7 @@ int configfs_unlink(struct inode *dir, struct dentry *dentry) struct configfs_dirent *sd = dentry->d_fsdata; struct configfs_symlink *sl; struct config_item *parent_item; - struct config_item_type *type; + const struct config_item_type *type; int ret; ret = -EPERM; /* What lack-of-symlink returns */ -- cgit v1.2.3