From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752611AbdJKNqe (ORCPT ); Wed, 11 Oct 2017 09:46:34 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:43592 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbdJKNqd (ORCPT ); Wed, 11 Oct 2017 09:46:33 -0400 X-Google-Smtp-Source: AOwi7QDupB/M5nhcpl8wbcWTBo/W33ebMNiCn3gPB+TP6nQNZokne13TwJdclMk/ivQ6jqZkPZXBdw== From: Bhumika Goyal To: julia.lawall@lip6.fr, jlbec@evilplan.org, hch@lst.de, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] configfs: make function arguments const Date: Wed, 11 Oct 2017 15:46:25 +0200 Message-Id: <1507729585-12981-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a followup patch for: https://lkml.org/lkml/2017/10/11/375 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 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 --- This change allows lots of config_item_type structure to be const. fs/configfs/dir.c | 2 +- fs/configfs/item.c | 4 ++-- include/linux/configfs.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 56fb261..46935fe 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -1810,7 +1810,7 @@ void configfs_unregister_group(struct config_group *group) struct config_group * configfs_register_default_group(struct config_group *parent_group, const char *name, - struct config_item_type *item_type) + const struct config_item_type *item_type) { int ret; struct config_group *group; diff --git a/fs/configfs/item.c b/fs/configfs/item.c index a66f662..b375b5e 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -113,7 +113,7 @@ int config_item_set_name(struct config_item *item, const char *fmt, ...) void config_item_init_type_name(struct config_item *item, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { config_item_set_name(item, "%s", name); item->ci_type = type; @@ -122,7 +122,7 @@ void config_item_init_type_name(struct config_item *item, EXPORT_SYMBOL(config_item_init_type_name); void config_group_init_type_name(struct config_group *group, const char *name, - struct config_item_type *type) + const struct config_item_type *type) { config_item_set_name(&group->cg_item, "%s", name); group->cg_item.ci_type = type; diff --git a/include/linux/configfs.h b/include/linux/configfs.h index c967090..acfc96f 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -72,7 +72,7 @@ static inline char *config_item_name(struct config_item * item) extern void config_item_init_type_name(struct config_item *item, const char *name, - struct config_item_type *type); + const struct config_item_type *type); extern struct config_item *config_item_get(struct config_item *); extern struct config_item *config_item_get_unless_zero(struct config_item *); @@ -101,7 +101,7 @@ struct config_group { extern void config_group_init(struct config_group *group); extern void config_group_init_type_name(struct config_group *group, const char *name, - struct config_item_type *type); + const struct config_item_type *type); static inline struct config_group *to_config_group(struct config_item *item) { @@ -261,7 +261,7 @@ int configfs_register_group(struct config_group *parent_group, struct config_group * configfs_register_default_group(struct config_group *parent_group, const char *name, - struct config_item_type *item_type); + const struct config_item_type *item_type); void configfs_unregister_default_group(struct config_group *group); /* These functions can sleep and can alloc with GFP_KERNEL */ -- 1.9.1