All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-12  8:49 Bhumika Goyal
  2017-10-14 11:50   ` [Ocfs2-devel] " kbuild test robot
  2017-10-14 12:14   ` [Ocfs2-devel] " kbuild test robot
  0 siblings, 2 replies; 11+ messages in thread
From: Bhumika Goyal @ 2017-10-12  8:49 UTC (permalink / raw)
  To: julia.lawall, mfasheh, jlbec, ocfs2-devel, linux-kernel; +Cc: Bhumika Goyal

This is a followup patch for: https://lkml.org/lkml/2017/10/11/375 and
https://patchwork.kernel.org/patch/9999649/

Make these structures const as they are either passed to the functions
having the argument as const or stored as a reference in the "ci_type"
const field of a config_item structure.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 fs/ocfs2/cluster/heartbeat.c   | 4 ++--
 fs/ocfs2/cluster/nodemanager.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index d020604..ea8c551 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -2025,7 +2025,7 @@ static ssize_t o2hb_region_pid_show(struct config_item *item, char *page)
 	.release		= o2hb_region_release,
 };
 
-static struct config_item_type o2hb_region_type = {
+static const struct config_item_type o2hb_region_type = {
 	.ct_item_ops	= &o2hb_region_item_ops,
 	.ct_attrs	= o2hb_region_attrs,
 	.ct_owner	= THIS_MODULE,
@@ -2310,7 +2310,7 @@ static ssize_t o2hb_heartbeat_group_mode_store(struct config_item *item,
 	.drop_item	= o2hb_heartbeat_group_drop_item,
 };
 
-static struct config_item_type o2hb_heartbeat_group_type = {
+static const struct config_item_type o2hb_heartbeat_group_type = {
 	.ct_group_ops	= &o2hb_heartbeat_group_group_ops,
 	.ct_attrs	= o2hb_heartbeat_group_attrs,
 	.ct_owner	= THIS_MODULE,
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index b17d180..3f2f87e 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -378,7 +378,7 @@ static ssize_t o2nm_node_local_store(struct config_item *item, const char *page,
 	.release		= o2nm_node_release,
 };
 
-static struct config_item_type o2nm_node_type = {
+static const struct config_item_type o2nm_node_type = {
 	.ct_item_ops	= &o2nm_node_item_ops,
 	.ct_attrs	= o2nm_node_attrs,
 	.ct_owner	= THIS_MODULE,
@@ -619,7 +619,7 @@ static void o2nm_node_group_drop_item(struct config_group *group,
 	.drop_item	= o2nm_node_group_drop_item,
 };
 
-static struct config_item_type o2nm_node_group_type = {
+static const struct config_item_type o2nm_node_group_type = {
 	.ct_group_ops	= &o2nm_node_group_group_ops,
 	.ct_owner	= THIS_MODULE,
 };
@@ -637,7 +637,7 @@ static void o2nm_cluster_release(struct config_item *item)
 	.release	= o2nm_cluster_release,
 };
 
-static struct config_item_type o2nm_cluster_type = {
+static const struct config_item_type o2nm_cluster_type = {
 	.ct_item_ops	= &o2nm_cluster_item_ops,
 	.ct_attrs	= o2nm_cluster_attrs,
 	.ct_owner	= THIS_MODULE,
@@ -727,7 +727,7 @@ static void o2nm_cluster_group_drop_item(struct config_group *group, struct conf
 	.ct_owner	= THIS_MODULE,
 };
 
-static struct o2nm_cluster_group o2nm_cluster_group = {
+static const struct o2nm_cluster_group o2nm_cluster_group = {
 	.cs_subsys = {
 		.su_group = {
 			.cg_item = {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] ocfs2/cluster: make config_item_type const
  2017-10-12  8:49 [PATCH] ocfs2/cluster: make config_item_type const Bhumika Goyal
@ 2017-10-14 11:50   ` kbuild test robot
  2017-10-14 12:14   ` [Ocfs2-devel] " kbuild test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2017-10-14 11:50 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: kbuild-all, julia.lawall, mfasheh, jlbec, ocfs2-devel,
	linux-kernel, Bhumika Goyal

[-- Attachment #1: Type: text/plain, Size: 43946 bytes --]

Hi Bhumika,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc4 next-20171013]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bhumika-Goyal/ocfs2-cluster-make-config_item_type-const/20171014-185701
config: i386-randconfig-x008-201741 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   fs/ocfs2//cluster/heartbeat.c: In function 'o2hb_heartbeat_group_make_item':
>> fs/ocfs2//cluster/heartbeat.c:2143:50: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
                                                     ^
   In file included from fs/ocfs2//cluster/heartbeat.c:32:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/heartbeat.c: In function 'o2hb_alloc_hb_set':
>> fs/ocfs2//cluster/heartbeat.c:2331:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2hb_heartbeat_group_type);
            ^
   In file included from fs/ocfs2//cluster/heartbeat.c:32:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from fs/ocfs2//cluster/heartbeat.c:22:
   fs/ocfs2//cluster/heartbeat.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'
     if (p_size < size || q_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:376:3: note: in expansion of macro 'if'
      if (q_size < size)
      ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:374:3: note: in expansion of macro 'if'
      if (p_size < size)
      ^~
--
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>> fs/ocfs2//cluster/nodemanager.c:573:51: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&node->nd_item, name, &o2nm_node_type);
                                                      ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
>> fs/ocfs2//cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_cluster_type);
            ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_node_group_type);
            ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_depend_item':
>> fs/ocfs2//cluster/nodemanager.c:743:30: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
                                 ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_depend_item(struct configfs_subsystem *subsys,
        ^~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'exit_o2nm':
>> fs/ocfs2//cluster/nodemanager.c:785:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'init_o2nm':
>> fs/ocfs2//cluster/nodemanager.c:808:20: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
                       ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
    extern void config_group_init(struct config_group *group);
                ^~~~~~~~~~~~~~~~~
   In file included from include/linux/notifier.h:13:0,
                    from include/linux/memory_hotplug.h:6,
                    from include/linux/mmzone.h:779,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from fs/ocfs2//cluster/nodemanager.c:22:
>> include/linux/mutex.h:113:15: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     __mutex_init((mutex), #mutex, &__key);    \
                  ^
>> fs/ocfs2//cluster/nodemanager.c:809:2: note: in expansion of macro 'mutex_init'
     mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
     ^~~~~~~~~~
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
    extern void __mutex_init(struct mutex *lock, const char *name,
                ^~~~~~~~~~~~
>> fs/ocfs2//cluster/nodemanager.c:810:36: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
                                       ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_register_subsystem(struct configfs_subsystem *subsys);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c:820:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from fs/ocfs2//cluster/nodemanager.c:22:
   fs/ocfs2//cluster/nodemanager.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'
     if (p_size < size || q_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:376:3: note: in expansion of macro 'if'
--
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
   fs/ocfs2/cluster/nodemanager.c:573:51: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&node->nd_item, name, &o2nm_node_type);
                                                      ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
   fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_cluster_type);
            ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_node_group_type);
            ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
   fs/ocfs2/cluster/nodemanager.c:743:30: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
                                 ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_depend_item(struct configfs_subsystem *subsys,
        ^~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
   fs/ocfs2/cluster/nodemanager.c:785:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
   fs/ocfs2/cluster/nodemanager.c:808:20: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
                       ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
    extern void config_group_init(struct config_group *group);
                ^~~~~~~~~~~~~~~~~
   In file included from include/linux/notifier.h:13:0,
                    from include/linux/memory_hotplug.h:6,
                    from include/linux/mmzone.h:779,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from fs/ocfs2/cluster/nodemanager.c:22:
>> include/linux/mutex.h:113:15: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     __mutex_init((mutex), #mutex, &__key);    \
                  ^
   fs/ocfs2/cluster/nodemanager.c:809:2: note: in expansion of macro 'mutex_init'
     mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
     ^~~~~~~~~~
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
    extern void __mutex_init(struct mutex *lock, const char *name,
                ^~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:810:36: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
                                       ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_register_subsystem(struct configfs_subsystem *subsys);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:820:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from fs/ocfs2/cluster/nodemanager.c:22:
   fs/ocfs2/cluster/nodemanager.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'

vim +2143 fs/ocfs2//cluster/heartbeat.c

1f28530537 Sunil Mushran     2010-10-06  2112  
f89ab8619e Joel Becker       2008-07-17  2113  static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
f89ab8619e Joel Becker       2008-07-17  2114  							  const char *name)
a7f6a5fb4b Mark Fasheh       2005-12-15  2115  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2116  	struct o2hb_region *reg = NULL;
1f28530537 Sunil Mushran     2010-10-06  2117  	int ret;
a7f6a5fb4b Mark Fasheh       2005-12-15  2118  
cd86128088 Robert P. J. Day  2006-12-13  2119  	reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
f89ab8619e Joel Becker       2008-07-17  2120  	if (reg == NULL)
a6795e9ebb Joel Becker       2008-07-17  2121  		return ERR_PTR(-ENOMEM);
a7f6a5fb4b Mark Fasheh       2005-12-15  2122  
1cf257f511 Jiri Slaby        2010-11-06  2123  	if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
1cf257f511 Jiri Slaby        2010-11-06  2124  		ret = -ENAMETOOLONG;
1cf257f511 Jiri Slaby        2010-11-06  2125  		goto free;
1cf257f511 Jiri Slaby        2010-11-06  2126  	}
b3c85c4cdf Sunil Mushran     2010-10-07  2127  
a7f6a5fb4b Mark Fasheh       2005-12-15  2128  	spin_lock(&o2hb_live_lock);
536f0741f3 Sunil Mushran     2010-10-07  2129  	reg->hr_region_num = 0;
536f0741f3 Sunil Mushran     2010-10-07  2130  	if (o2hb_global_heartbeat_active()) {
536f0741f3 Sunil Mushran     2010-10-07  2131  		reg->hr_region_num = find_first_zero_bit(o2hb_region_bitmap,
536f0741f3 Sunil Mushran     2010-10-07  2132  							 O2NM_MAX_REGIONS);
536f0741f3 Sunil Mushran     2010-10-07  2133  		if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
536f0741f3 Sunil Mushran     2010-10-07  2134  			spin_unlock(&o2hb_live_lock);
1cf257f511 Jiri Slaby        2010-11-06  2135  			ret = -EFBIG;
1cf257f511 Jiri Slaby        2010-11-06  2136  			goto free;
536f0741f3 Sunil Mushran     2010-10-07  2137  		}
536f0741f3 Sunil Mushran     2010-10-07  2138  		set_bit(reg->hr_region_num, o2hb_region_bitmap);
536f0741f3 Sunil Mushran     2010-10-07  2139  	}
a7f6a5fb4b Mark Fasheh       2005-12-15  2140  	list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
a7f6a5fb4b Mark Fasheh       2005-12-15  2141  	spin_unlock(&o2hb_live_lock);
a7f6a5fb4b Mark Fasheh       2005-12-15  2142  
536f0741f3 Sunil Mushran     2010-10-07 @2143  	config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
536f0741f3 Sunil Mushran     2010-10-07  2144  
34069b886f Junxiao Bi        2016-05-27  2145  	/* this is the same way to generate msg key as dlm, for local heartbeat,
34069b886f Junxiao Bi        2016-05-27  2146  	 * name is also the same, so make initial crc value different to avoid
34069b886f Junxiao Bi        2016-05-27  2147  	 * message key conflict.
34069b886f Junxiao Bi        2016-05-27  2148  	 */
34069b886f Junxiao Bi        2016-05-27  2149  	reg->hr_key = crc32_le(reg->hr_region_num + O2NM_MAX_REGIONS,
34069b886f Junxiao Bi        2016-05-27  2150  		name, strlen(name));
34069b886f Junxiao Bi        2016-05-27  2151  	INIT_LIST_HEAD(&reg->hr_handler_list);
34069b886f Junxiao Bi        2016-05-27  2152  	ret = o2net_register_handler(O2HB_NEGO_TIMEOUT_MSG, reg->hr_key,
34069b886f Junxiao Bi        2016-05-27  2153  			sizeof(struct o2hb_nego_msg),
34069b886f Junxiao Bi        2016-05-27  2154  			o2hb_nego_timeout_handler,
34069b886f Junxiao Bi        2016-05-27  2155  			reg, NULL, &reg->hr_handler_list);
34069b886f Junxiao Bi        2016-05-27  2156  	if (ret)
34069b886f Junxiao Bi        2016-05-27  2157  		goto free;
34069b886f Junxiao Bi        2016-05-27  2158  
e76f8237a2 Junxiao Bi        2016-05-27  2159  	ret = o2net_register_handler(O2HB_NEGO_APPROVE_MSG, reg->hr_key,
e76f8237a2 Junxiao Bi        2016-05-27  2160  			sizeof(struct o2hb_nego_msg),
e76f8237a2 Junxiao Bi        2016-05-27  2161  			o2hb_nego_approve_handler,
e76f8237a2 Junxiao Bi        2016-05-27  2162  			reg, NULL, &reg->hr_handler_list);
e76f8237a2 Junxiao Bi        2016-05-27  2163  	if (ret)
e76f8237a2 Junxiao Bi        2016-05-27  2164  		goto unregister_handler;
e76f8237a2 Junxiao Bi        2016-05-27  2165  
1f28530537 Sunil Mushran     2010-10-06  2166  	ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
1f28530537 Sunil Mushran     2010-10-06  2167  	if (ret) {
1f28530537 Sunil Mushran     2010-10-06  2168  		config_item_put(&reg->hr_item);
34069b886f Junxiao Bi        2016-05-27  2169  		goto unregister_handler;
1f28530537 Sunil Mushran     2010-10-06  2170  	}
1f28530537 Sunil Mushran     2010-10-06  2171  
a6795e9ebb Joel Becker       2008-07-17  2172  	return &reg->hr_item;
34069b886f Junxiao Bi        2016-05-27  2173  
34069b886f Junxiao Bi        2016-05-27  2174  unregister_handler:
34069b886f Junxiao Bi        2016-05-27  2175  	o2net_unregister_handler_list(&reg->hr_handler_list);
1cf257f511 Jiri Slaby        2010-11-06  2176  free:
1cf257f511 Jiri Slaby        2010-11-06  2177  	kfree(reg);
1cf257f511 Jiri Slaby        2010-11-06  2178  	return ERR_PTR(ret);
a7f6a5fb4b Mark Fasheh       2005-12-15  2179  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2180  
a7f6a5fb4b Mark Fasheh       2005-12-15  2181  static void o2hb_heartbeat_group_drop_item(struct config_group *group,
a7f6a5fb4b Mark Fasheh       2005-12-15  2182  					   struct config_item *item)
a7f6a5fb4b Mark Fasheh       2005-12-15  2183  {
e6c352dbc0 Joel Becker       2007-02-03  2184  	struct task_struct *hb_task;
a7f6a5fb4b Mark Fasheh       2005-12-15  2185  	struct o2hb_region *reg = to_o2hb_region(item);
58a3158a5d Sunil Mushran     2010-12-14  2186  	int quorum_region = 0;
a7f6a5fb4b Mark Fasheh       2005-12-15  2187  
a7f6a5fb4b Mark Fasheh       2005-12-15  2188  	/* stop the thread when the user removes the region dir */
e6c352dbc0 Joel Becker       2007-02-03  2189  	spin_lock(&o2hb_live_lock);
e6c352dbc0 Joel Becker       2007-02-03  2190  	hb_task = reg->hr_task;
a7f6a5fb4b Mark Fasheh       2005-12-15  2191  	reg->hr_task = NULL;
58a3158a5d Sunil Mushran     2010-12-14  2192  	reg->hr_item_dropped = 1;
e6c352dbc0 Joel Becker       2007-02-03  2193  	spin_unlock(&o2hb_live_lock);
e6c352dbc0 Joel Becker       2007-02-03  2194  
e6c352dbc0 Joel Becker       2007-02-03  2195  	if (hb_task)
e6c352dbc0 Joel Becker       2007-02-03  2196  		kthread_stop(hb_task);
a7f6a5fb4b Mark Fasheh       2005-12-15  2197  
d2eece3766 Sunil Mushran     2011-07-24  2198  	if (o2hb_global_heartbeat_active()) {
d2eece3766 Sunil Mushran     2011-07-24  2199  		spin_lock(&o2hb_live_lock);
d2eece3766 Sunil Mushran     2011-07-24  2200  		clear_bit(reg->hr_region_num, o2hb_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2201  		clear_bit(reg->hr_region_num, o2hb_live_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2202  		if (test_bit(reg->hr_region_num, o2hb_quorum_region_bitmap))
d2eece3766 Sunil Mushran     2011-07-24  2203  			quorum_region = 1;
d2eece3766 Sunil Mushran     2011-07-24  2204  		clear_bit(reg->hr_region_num, o2hb_quorum_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2205  		spin_unlock(&o2hb_live_lock);
d2eece3766 Sunil Mushran     2011-07-24  2206  		printk(KERN_NOTICE "o2hb: Heartbeat %s on region %s (%s)\n",
d2eece3766 Sunil Mushran     2011-07-24  2207  		       ((atomic_read(&reg->hr_steady_iterations) == 0) ?
d2eece3766 Sunil Mushran     2011-07-24  2208  			"stopped" : "start aborted"), config_item_name(item),
d2eece3766 Sunil Mushran     2011-07-24  2209  		       reg->hr_dev_name);
d2eece3766 Sunil Mushran     2011-07-24  2210  	}
d2eece3766 Sunil Mushran     2011-07-24  2211  
e6df3a663a Joel Becker       2007-02-06  2212  	/*
e6df3a663a Joel Becker       2007-02-06  2213  	 * If we're racing a dev_write(), we need to wake them.  They will
e6df3a663a Joel Becker       2007-02-06  2214  	 * check reg->hr_task
e6df3a663a Joel Becker       2007-02-06  2215  	 */
e6df3a663a Joel Becker       2007-02-06  2216  	if (atomic_read(&reg->hr_steady_iterations) != 0) {
d2eece3766 Sunil Mushran     2011-07-24  2217  		reg->hr_aborted_start = 1;
e6df3a663a Joel Becker       2007-02-06  2218  		atomic_set(&reg->hr_steady_iterations, 0);
e6df3a663a Joel Becker       2007-02-06  2219  		wake_up(&o2hb_steady_queue);
e6df3a663a Joel Becker       2007-02-06  2220  	}
e6df3a663a Joel Becker       2007-02-06  2221  
a7f6a5fb4b Mark Fasheh       2005-12-15  2222  	config_item_put(item);
58a3158a5d Sunil Mushran     2010-12-14  2223  
58a3158a5d Sunil Mushran     2010-12-14  2224  	if (!o2hb_global_heartbeat_active() || !quorum_region)
58a3158a5d Sunil Mushran     2010-12-14  2225  		return;
58a3158a5d Sunil Mushran     2010-12-14  2226  
58a3158a5d Sunil Mushran     2010-12-14  2227  	/*
58a3158a5d Sunil Mushran     2010-12-14  2228  	 * If global heartbeat active and there are dependent users,
58a3158a5d Sunil Mushran     2010-12-14  2229  	 * pin all regions if quorum region count <= CUT_OFF
58a3158a5d Sunil Mushran     2010-12-14  2230  	 */
58a3158a5d Sunil Mushran     2010-12-14  2231  	spin_lock(&o2hb_live_lock);
58a3158a5d Sunil Mushran     2010-12-14  2232  
58a3158a5d Sunil Mushran     2010-12-14  2233  	if (!o2hb_dependent_users)
58a3158a5d Sunil Mushran     2010-12-14  2234  		goto unlock;
58a3158a5d Sunil Mushran     2010-12-14  2235  
a8f70de37b Akinobu Mita      2013-11-12  2236  	if (bitmap_weight(o2hb_quorum_region_bitmap,
58a3158a5d Sunil Mushran     2010-12-14  2237  			   O2NM_MAX_REGIONS) <= O2HB_PIN_CUT_OFF)
58a3158a5d Sunil Mushran     2010-12-14  2238  		o2hb_region_pin(NULL);
58a3158a5d Sunil Mushran     2010-12-14  2239  
58a3158a5d Sunil Mushran     2010-12-14  2240  unlock:
58a3158a5d Sunil Mushran     2010-12-14  2241  	spin_unlock(&o2hb_live_lock);
a7f6a5fb4b Mark Fasheh       2005-12-15  2242  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2243  
33496c3c3d Junxiao Bi        2017-05-03  2244  static ssize_t o2hb_heartbeat_group_dead_threshold_show(struct config_item *item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2245  		char *page)
a7f6a5fb4b Mark Fasheh       2005-12-15  2246  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2247  	return sprintf(page, "%u\n", o2hb_dead_threshold);
a7f6a5fb4b Mark Fasheh       2005-12-15  2248  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2249  
33496c3c3d Junxiao Bi        2017-05-03  2250  static ssize_t o2hb_heartbeat_group_dead_threshold_store(struct config_item *item,
45b997737a Christoph Hellwig 2015-10-03  2251  		const char *page, size_t count)
a7f6a5fb4b Mark Fasheh       2005-12-15  2252  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2253  	unsigned long tmp;
a7f6a5fb4b Mark Fasheh       2005-12-15  2254  	char *p = (char *)page;
a7f6a5fb4b Mark Fasheh       2005-12-15  2255  
a7f6a5fb4b Mark Fasheh       2005-12-15  2256  	tmp = simple_strtoul(p, &p, 10);
a7f6a5fb4b Mark Fasheh       2005-12-15  2257  	if (!p || (*p && (*p != '\n')))
a7f6a5fb4b Mark Fasheh       2005-12-15  2258                  return -EINVAL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2259  
a7f6a5fb4b Mark Fasheh       2005-12-15  2260  	/* this will validate ranges for us. */
a7f6a5fb4b Mark Fasheh       2005-12-15  2261  	o2hb_dead_threshold_set((unsigned int) tmp);
a7f6a5fb4b Mark Fasheh       2005-12-15  2262  
a7f6a5fb4b Mark Fasheh       2005-12-15  2263  	return count;
a7f6a5fb4b Mark Fasheh       2005-12-15  2264  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2265  
45b997737a Christoph Hellwig 2015-10-03  2266  static ssize_t o2hb_heartbeat_group_mode_show(struct config_item *item,
54b5187b5a Sunil Mushran     2010-10-07  2267  		char *page)
54b5187b5a Sunil Mushran     2010-10-07  2268  {
54b5187b5a Sunil Mushran     2010-10-07  2269  	return sprintf(page, "%s\n",
54b5187b5a Sunil Mushran     2010-10-07  2270  		       o2hb_heartbeat_mode_desc[o2hb_heartbeat_mode]);
54b5187b5a Sunil Mushran     2010-10-07  2271  }
54b5187b5a Sunil Mushran     2010-10-07  2272  
45b997737a Christoph Hellwig 2015-10-03  2273  static ssize_t o2hb_heartbeat_group_mode_store(struct config_item *item,
54b5187b5a Sunil Mushran     2010-10-07  2274  		const char *page, size_t count)
54b5187b5a Sunil Mushran     2010-10-07  2275  {
54b5187b5a Sunil Mushran     2010-10-07  2276  	unsigned int i;
54b5187b5a Sunil Mushran     2010-10-07  2277  	int ret;
54b5187b5a Sunil Mushran     2010-10-07  2278  	size_t len;
54b5187b5a Sunil Mushran     2010-10-07  2279  
54b5187b5a Sunil Mushran     2010-10-07  2280  	len = (page[count - 1] == '\n') ? count - 1 : count;
54b5187b5a Sunil Mushran     2010-10-07  2281  	if (!len)
54b5187b5a Sunil Mushran     2010-10-07  2282  		return -EINVAL;
54b5187b5a Sunil Mushran     2010-10-07  2283  
54b5187b5a Sunil Mushran     2010-10-07  2284  	for (i = 0; i < O2HB_HEARTBEAT_NUM_MODES; ++i) {
2bd63329cb Rasmus Villemoes  2014-10-13  2285  		if (strncasecmp(page, o2hb_heartbeat_mode_desc[i], len))
54b5187b5a Sunil Mushran     2010-10-07  2286  			continue;
54b5187b5a Sunil Mushran     2010-10-07  2287  
70f651edb7 Jie Liu           2013-07-03  2288  		ret = o2hb_global_heartbeat_mode_set(i);
54b5187b5a Sunil Mushran     2010-10-07  2289  		if (!ret)
18c50cb0d3 Sunil Mushran     2010-10-06  2290  			printk(KERN_NOTICE "o2hb: Heartbeat mode set to %s\n",
54b5187b5a Sunil Mushran     2010-10-07  2291  			       o2hb_heartbeat_mode_desc[i]);
54b5187b5a Sunil Mushran     2010-10-07  2292  		return count;
54b5187b5a Sunil Mushran     2010-10-07  2293  	}
54b5187b5a Sunil Mushran     2010-10-07  2294  
54b5187b5a Sunil Mushran     2010-10-07  2295  	return -EINVAL;
54b5187b5a Sunil Mushran     2010-10-07  2296  
54b5187b5a Sunil Mushran     2010-10-07  2297  }
54b5187b5a Sunil Mushran     2010-10-07  2298  
33496c3c3d Junxiao Bi        2017-05-03  2299  CONFIGFS_ATTR(o2hb_heartbeat_group_, dead_threshold);
45b997737a Christoph Hellwig 2015-10-03  2300  CONFIGFS_ATTR(o2hb_heartbeat_group_, mode);
54b5187b5a Sunil Mushran     2010-10-07  2301  
a7f6a5fb4b Mark Fasheh       2005-12-15  2302  static struct configfs_attribute *o2hb_heartbeat_group_attrs[] = {
33496c3c3d Junxiao Bi        2017-05-03  2303  	&o2hb_heartbeat_group_attr_dead_threshold,
45b997737a Christoph Hellwig 2015-10-03  2304  	&o2hb_heartbeat_group_attr_mode,
a7f6a5fb4b Mark Fasheh       2005-12-15  2305  	NULL,
a7f6a5fb4b Mark Fasheh       2005-12-15  2306  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2307  
a7f6a5fb4b Mark Fasheh       2005-12-15  2308  static struct configfs_group_operations o2hb_heartbeat_group_group_ops = {
a7f6a5fb4b Mark Fasheh       2005-12-15  2309  	.make_item	= o2hb_heartbeat_group_make_item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2310  	.drop_item	= o2hb_heartbeat_group_drop_item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2311  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2312  
6c56d97a81 Bhumika Goyal     2017-10-12  2313  static const struct config_item_type o2hb_heartbeat_group_type = {
a7f6a5fb4b Mark Fasheh       2005-12-15  2314  	.ct_group_ops	= &o2hb_heartbeat_group_group_ops,
a7f6a5fb4b Mark Fasheh       2005-12-15  2315  	.ct_attrs	= o2hb_heartbeat_group_attrs,
a7f6a5fb4b Mark Fasheh       2005-12-15  2316  	.ct_owner	= THIS_MODULE,
a7f6a5fb4b Mark Fasheh       2005-12-15  2317  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2318  
a7f6a5fb4b Mark Fasheh       2005-12-15  2319  /* this is just here to avoid touching group in heartbeat.h which the
a7f6a5fb4b Mark Fasheh       2005-12-15  2320   * entire damn world #includes */
a7f6a5fb4b Mark Fasheh       2005-12-15  2321  struct config_group *o2hb_alloc_hb_set(void)
a7f6a5fb4b Mark Fasheh       2005-12-15  2322  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2323  	struct o2hb_heartbeat_group *hs = NULL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2324  	struct config_group *ret = NULL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2325  
cd86128088 Robert P. J. Day  2006-12-13  2326  	hs = kzalloc(sizeof(struct o2hb_heartbeat_group), GFP_KERNEL);
a7f6a5fb4b Mark Fasheh       2005-12-15  2327  	if (hs == NULL)
a7f6a5fb4b Mark Fasheh       2005-12-15  2328  		goto out;
a7f6a5fb4b Mark Fasheh       2005-12-15  2329  
a7f6a5fb4b Mark Fasheh       2005-12-15  2330  	config_group_init_type_name(&hs->hs_group, "heartbeat",
a7f6a5fb4b Mark Fasheh       2005-12-15 @2331  				    &o2hb_heartbeat_group_type);
a7f6a5fb4b Mark Fasheh       2005-12-15  2332  
a7f6a5fb4b Mark Fasheh       2005-12-15  2333  	ret = &hs->hs_group;
a7f6a5fb4b Mark Fasheh       2005-12-15  2334  out:
a7f6a5fb4b Mark Fasheh       2005-12-15  2335  	if (ret == NULL)
a7f6a5fb4b Mark Fasheh       2005-12-15  2336  		kfree(hs);
a7f6a5fb4b Mark Fasheh       2005-12-15  2337  	return ret;
a7f6a5fb4b Mark Fasheh       2005-12-15  2338  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2339  

:::::: The code at line 2143 was first introduced by commit
:::::: 536f0741f324f116d8b059295999945a2dac56bc ocfs2/cluster: Track number of global heartbeat regions

:::::: TO: Sunil Mushran <sunil.mushran@oracle.com>
:::::: CC: Sunil Mushran <sunil.mushran@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30338 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-14 11:50   ` kbuild test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2017-10-14 11:50 UTC (permalink / raw)
  To: ocfs2-devel

Hi Bhumika,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc4 next-20171013]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_linux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_20171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=4fT109phFDGTzLoQ_1gyG5rGk7zpX7-tjDNQTcZkrKc&s=aoUCsoVesff8xh5AWS-g_njVmN940HU08w2FgnVWwvU&e= 
config: i386-randconfig-x008-201741 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   fs/ocfs2//cluster/heartbeat.c: In function 'o2hb_heartbeat_group_make_item':
>> fs/ocfs2//cluster/heartbeat.c:2143:50: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
                                                     ^
   In file included from fs/ocfs2//cluster/heartbeat.c:32:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/heartbeat.c: In function 'o2hb_alloc_hb_set':
>> fs/ocfs2//cluster/heartbeat.c:2331:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2hb_heartbeat_group_type);
            ^
   In file included from fs/ocfs2//cluster/heartbeat.c:32:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from fs/ocfs2//cluster/heartbeat.c:22:
   fs/ocfs2//cluster/heartbeat.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'
     if (p_size < size || q_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:376:3: note: in expansion of macro 'if'
      if (q_size < size)
      ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:374:3: note: in expansion of macro 'if'
      if (p_size < size)
      ^~
--
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>> fs/ocfs2//cluster/nodemanager.c:573:51: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&node->nd_item, name, &o2nm_node_type);
                                                      ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
>> fs/ocfs2//cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_cluster_type);
            ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_node_group_type);
            ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'o2nm_depend_item':
>> fs/ocfs2//cluster/nodemanager.c:743:30: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
                                 ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_depend_item(struct configfs_subsystem *subsys,
        ^~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'exit_o2nm':
>> fs/ocfs2//cluster/nodemanager.c:785:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c: In function 'init_o2nm':
>> fs/ocfs2//cluster/nodemanager.c:808:20: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
                       ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
    extern void config_group_init(struct config_group *group);
                ^~~~~~~~~~~~~~~~~
   In file included from include/linux/notifier.h:13:0,
                    from include/linux/memory_hotplug.h:6,
                    from include/linux/mmzone.h:779,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from fs/ocfs2//cluster/nodemanager.c:22:
>> include/linux/mutex.h:113:15: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     __mutex_init((mutex), #mutex, &__key);    \
                  ^
>> fs/ocfs2//cluster/nodemanager.c:809:2: note: in expansion of macro 'mutex_init'
     mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
     ^~~~~~~~~~
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
    extern void __mutex_init(struct mutex *lock, const char *name,
                ^~~~~~~~~~~~
>> fs/ocfs2//cluster/nodemanager.c:810:36: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
                                       ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_register_subsystem(struct configfs_subsystem *subsys);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2//cluster/nodemanager.c:820:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2//cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from fs/ocfs2//cluster/nodemanager.c:22:
   fs/ocfs2//cluster/nodemanager.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'
     if (p_size < size || q_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:376:3: note: in expansion of macro 'if'
--
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
   fs/ocfs2/cluster/nodemanager.c:573:51: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&node->nd_item, name, &o2nm_node_type);
                                                      ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_item_init_type_name(struct config_item *item,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
   fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_cluster_type);
            ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
            &o2nm_node_group_type);
            ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
    extern void config_group_init_type_name(struct config_group *group,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
   fs/ocfs2/cluster/nodemanager.c:743:30: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
                                 ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_depend_item(struct configfs_subsystem *subsys,
        ^~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
   fs/ocfs2/cluster/nodemanager.c:785:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
   fs/ocfs2/cluster/nodemanager.c:808:20: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
                       ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
    extern void config_group_init(struct config_group *group);
                ^~~~~~~~~~~~~~~~~
   In file included from include/linux/notifier.h:13:0,
                    from include/linux/memory_hotplug.h:6,
                    from include/linux/mmzone.h:779,
                    from include/linux/gfp.h:5,
                    from include/linux/slab.h:14,
                    from fs/ocfs2/cluster/nodemanager.c:22:
>> include/linux/mutex.h:113:15: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     __mutex_init((mutex), #mutex, &__key);    \
                  ^
   fs/ocfs2/cluster/nodemanager.c:809:2: note: in expansion of macro 'mutex_init'
     mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
     ^~~~~~~~~~
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
    extern void __mutex_init(struct mutex *lock, const char *name,
                ^~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:810:36: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
                                       ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    int configfs_register_subsystem(struct configfs_subsystem *subsys);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/cluster/nodemanager.c:820:32: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
                                   ^
   In file included from fs/ocfs2/cluster/nodemanager.c:25:0:
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
    void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:4:0,
                    from arch/x86/include/asm/bug.h:81,
                    from include/linux/bug.h:4,
                    from include/linux/mmdebug.h:4,
                    from include/linux/gfp.h:4,
                    from include/linux/slab.h:14,
                    from fs/ocfs2/cluster/nodemanager.c:22:
   fs/ocfs2/cluster/nodemanager.c: At top level:
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:421:2: note: in expansion of macro 'if'
     if (p_size == (size_t)-1 && q_size == (size_t)-1)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:411:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:409:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:400:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:398:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:389:2: note: in expansion of macro 'if'
     if (p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memchr' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:387:2: note: in expansion of macro 'if'
     if (__builtin_constant_p(size) && p_size < size)
     ^~
   include/linux/compiler.h:162:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static
       ______f = {     \
       ^
   include/linux/compiler.h:154:23: note: in expansion of macro '__trace_if'
    #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
                          ^~~~~~~~~~
   include/linux/string.h:379:2: note: in expansion of macro 'if'

vim +2143 fs/ocfs2//cluster/heartbeat.c

1f28530537 Sunil Mushran     2010-10-06  2112  
f89ab8619e Joel Becker       2008-07-17  2113  static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *group,
f89ab8619e Joel Becker       2008-07-17  2114  							  const char *name)
a7f6a5fb4b Mark Fasheh       2005-12-15  2115  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2116  	struct o2hb_region *reg = NULL;
1f28530537 Sunil Mushran     2010-10-06  2117  	int ret;
a7f6a5fb4b Mark Fasheh       2005-12-15  2118  
cd86128088 Robert P. J. Day  2006-12-13  2119  	reg = kzalloc(sizeof(struct o2hb_region), GFP_KERNEL);
f89ab8619e Joel Becker       2008-07-17  2120  	if (reg == NULL)
a6795e9ebb Joel Becker       2008-07-17  2121  		return ERR_PTR(-ENOMEM);
a7f6a5fb4b Mark Fasheh       2005-12-15  2122  
1cf257f511 Jiri Slaby        2010-11-06  2123  	if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) {
1cf257f511 Jiri Slaby        2010-11-06  2124  		ret = -ENAMETOOLONG;
1cf257f511 Jiri Slaby        2010-11-06  2125  		goto free;
1cf257f511 Jiri Slaby        2010-11-06  2126  	}
b3c85c4cdf Sunil Mushran     2010-10-07  2127  
a7f6a5fb4b Mark Fasheh       2005-12-15  2128  	spin_lock(&o2hb_live_lock);
536f0741f3 Sunil Mushran     2010-10-07  2129  	reg->hr_region_num = 0;
536f0741f3 Sunil Mushran     2010-10-07  2130  	if (o2hb_global_heartbeat_active()) {
536f0741f3 Sunil Mushran     2010-10-07  2131  		reg->hr_region_num = find_first_zero_bit(o2hb_region_bitmap,
536f0741f3 Sunil Mushran     2010-10-07  2132  							 O2NM_MAX_REGIONS);
536f0741f3 Sunil Mushran     2010-10-07  2133  		if (reg->hr_region_num >= O2NM_MAX_REGIONS) {
536f0741f3 Sunil Mushran     2010-10-07  2134  			spin_unlock(&o2hb_live_lock);
1cf257f511 Jiri Slaby        2010-11-06  2135  			ret = -EFBIG;
1cf257f511 Jiri Slaby        2010-11-06  2136  			goto free;
536f0741f3 Sunil Mushran     2010-10-07  2137  		}
536f0741f3 Sunil Mushran     2010-10-07  2138  		set_bit(reg->hr_region_num, o2hb_region_bitmap);
536f0741f3 Sunil Mushran     2010-10-07  2139  	}
a7f6a5fb4b Mark Fasheh       2005-12-15  2140  	list_add_tail(&reg->hr_all_item, &o2hb_all_regions);
a7f6a5fb4b Mark Fasheh       2005-12-15  2141  	spin_unlock(&o2hb_live_lock);
a7f6a5fb4b Mark Fasheh       2005-12-15  2142  
536f0741f3 Sunil Mushran     2010-10-07 @2143  	config_item_init_type_name(&reg->hr_item, name, &o2hb_region_type);
536f0741f3 Sunil Mushran     2010-10-07  2144  
34069b886f Junxiao Bi        2016-05-27  2145  	/* this is the same way to generate msg key as dlm, for local heartbeat,
34069b886f Junxiao Bi        2016-05-27  2146  	 * name is also the same, so make initial crc value different to avoid
34069b886f Junxiao Bi        2016-05-27  2147  	 * message key conflict.
34069b886f Junxiao Bi        2016-05-27  2148  	 */
34069b886f Junxiao Bi        2016-05-27  2149  	reg->hr_key = crc32_le(reg->hr_region_num + O2NM_MAX_REGIONS,
34069b886f Junxiao Bi        2016-05-27  2150  		name, strlen(name));
34069b886f Junxiao Bi        2016-05-27  2151  	INIT_LIST_HEAD(&reg->hr_handler_list);
34069b886f Junxiao Bi        2016-05-27  2152  	ret = o2net_register_handler(O2HB_NEGO_TIMEOUT_MSG, reg->hr_key,
34069b886f Junxiao Bi        2016-05-27  2153  			sizeof(struct o2hb_nego_msg),
34069b886f Junxiao Bi        2016-05-27  2154  			o2hb_nego_timeout_handler,
34069b886f Junxiao Bi        2016-05-27  2155  			reg, NULL, &reg->hr_handler_list);
34069b886f Junxiao Bi        2016-05-27  2156  	if (ret)
34069b886f Junxiao Bi        2016-05-27  2157  		goto free;
34069b886f Junxiao Bi        2016-05-27  2158  
e76f8237a2 Junxiao Bi        2016-05-27  2159  	ret = o2net_register_handler(O2HB_NEGO_APPROVE_MSG, reg->hr_key,
e76f8237a2 Junxiao Bi        2016-05-27  2160  			sizeof(struct o2hb_nego_msg),
e76f8237a2 Junxiao Bi        2016-05-27  2161  			o2hb_nego_approve_handler,
e76f8237a2 Junxiao Bi        2016-05-27  2162  			reg, NULL, &reg->hr_handler_list);
e76f8237a2 Junxiao Bi        2016-05-27  2163  	if (ret)
e76f8237a2 Junxiao Bi        2016-05-27  2164  		goto unregister_handler;
e76f8237a2 Junxiao Bi        2016-05-27  2165  
1f28530537 Sunil Mushran     2010-10-06  2166  	ret = o2hb_debug_region_init(reg, o2hb_debug_dir);
1f28530537 Sunil Mushran     2010-10-06  2167  	if (ret) {
1f28530537 Sunil Mushran     2010-10-06  2168  		config_item_put(&reg->hr_item);
34069b886f Junxiao Bi        2016-05-27  2169  		goto unregister_handler;
1f28530537 Sunil Mushran     2010-10-06  2170  	}
1f28530537 Sunil Mushran     2010-10-06  2171  
a6795e9ebb Joel Becker       2008-07-17  2172  	return &reg->hr_item;
34069b886f Junxiao Bi        2016-05-27  2173  
34069b886f Junxiao Bi        2016-05-27  2174  unregister_handler:
34069b886f Junxiao Bi        2016-05-27  2175  	o2net_unregister_handler_list(&reg->hr_handler_list);
1cf257f511 Jiri Slaby        2010-11-06  2176  free:
1cf257f511 Jiri Slaby        2010-11-06  2177  	kfree(reg);
1cf257f511 Jiri Slaby        2010-11-06  2178  	return ERR_PTR(ret);
a7f6a5fb4b Mark Fasheh       2005-12-15  2179  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2180  
a7f6a5fb4b Mark Fasheh       2005-12-15  2181  static void o2hb_heartbeat_group_drop_item(struct config_group *group,
a7f6a5fb4b Mark Fasheh       2005-12-15  2182  					   struct config_item *item)
a7f6a5fb4b Mark Fasheh       2005-12-15  2183  {
e6c352dbc0 Joel Becker       2007-02-03  2184  	struct task_struct *hb_task;
a7f6a5fb4b Mark Fasheh       2005-12-15  2185  	struct o2hb_region *reg = to_o2hb_region(item);
58a3158a5d Sunil Mushran     2010-12-14  2186  	int quorum_region = 0;
a7f6a5fb4b Mark Fasheh       2005-12-15  2187  
a7f6a5fb4b Mark Fasheh       2005-12-15  2188  	/* stop the thread when the user removes the region dir */
e6c352dbc0 Joel Becker       2007-02-03  2189  	spin_lock(&o2hb_live_lock);
e6c352dbc0 Joel Becker       2007-02-03  2190  	hb_task = reg->hr_task;
a7f6a5fb4b Mark Fasheh       2005-12-15  2191  	reg->hr_task = NULL;
58a3158a5d Sunil Mushran     2010-12-14  2192  	reg->hr_item_dropped = 1;
e6c352dbc0 Joel Becker       2007-02-03  2193  	spin_unlock(&o2hb_live_lock);
e6c352dbc0 Joel Becker       2007-02-03  2194  
e6c352dbc0 Joel Becker       2007-02-03  2195  	if (hb_task)
e6c352dbc0 Joel Becker       2007-02-03  2196  		kthread_stop(hb_task);
a7f6a5fb4b Mark Fasheh       2005-12-15  2197  
d2eece3766 Sunil Mushran     2011-07-24  2198  	if (o2hb_global_heartbeat_active()) {
d2eece3766 Sunil Mushran     2011-07-24  2199  		spin_lock(&o2hb_live_lock);
d2eece3766 Sunil Mushran     2011-07-24  2200  		clear_bit(reg->hr_region_num, o2hb_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2201  		clear_bit(reg->hr_region_num, o2hb_live_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2202  		if (test_bit(reg->hr_region_num, o2hb_quorum_region_bitmap))
d2eece3766 Sunil Mushran     2011-07-24  2203  			quorum_region = 1;
d2eece3766 Sunil Mushran     2011-07-24  2204  		clear_bit(reg->hr_region_num, o2hb_quorum_region_bitmap);
d2eece3766 Sunil Mushran     2011-07-24  2205  		spin_unlock(&o2hb_live_lock);
d2eece3766 Sunil Mushran     2011-07-24  2206  		printk(KERN_NOTICE "o2hb: Heartbeat %s on region %s (%s)\n",
d2eece3766 Sunil Mushran     2011-07-24  2207  		       ((atomic_read(&reg->hr_steady_iterations) == 0) ?
d2eece3766 Sunil Mushran     2011-07-24  2208  			"stopped" : "start aborted"), config_item_name(item),
d2eece3766 Sunil Mushran     2011-07-24  2209  		       reg->hr_dev_name);
d2eece3766 Sunil Mushran     2011-07-24  2210  	}
d2eece3766 Sunil Mushran     2011-07-24  2211  
e6df3a663a Joel Becker       2007-02-06  2212  	/*
e6df3a663a Joel Becker       2007-02-06  2213  	 * If we're racing a dev_write(), we need to wake them.  They will
e6df3a663a Joel Becker       2007-02-06  2214  	 * check reg->hr_task
e6df3a663a Joel Becker       2007-02-06  2215  	 */
e6df3a663a Joel Becker       2007-02-06  2216  	if (atomic_read(&reg->hr_steady_iterations) != 0) {
d2eece3766 Sunil Mushran     2011-07-24  2217  		reg->hr_aborted_start = 1;
e6df3a663a Joel Becker       2007-02-06  2218  		atomic_set(&reg->hr_steady_iterations, 0);
e6df3a663a Joel Becker       2007-02-06  2219  		wake_up(&o2hb_steady_queue);
e6df3a663a Joel Becker       2007-02-06  2220  	}
e6df3a663a Joel Becker       2007-02-06  2221  
a7f6a5fb4b Mark Fasheh       2005-12-15  2222  	config_item_put(item);
58a3158a5d Sunil Mushran     2010-12-14  2223  
58a3158a5d Sunil Mushran     2010-12-14  2224  	if (!o2hb_global_heartbeat_active() || !quorum_region)
58a3158a5d Sunil Mushran     2010-12-14  2225  		return;
58a3158a5d Sunil Mushran     2010-12-14  2226  
58a3158a5d Sunil Mushran     2010-12-14  2227  	/*
58a3158a5d Sunil Mushran     2010-12-14  2228  	 * If global heartbeat active and there are dependent users,
58a3158a5d Sunil Mushran     2010-12-14  2229  	 * pin all regions if quorum region count <= CUT_OFF
58a3158a5d Sunil Mushran     2010-12-14  2230  	 */
58a3158a5d Sunil Mushran     2010-12-14  2231  	spin_lock(&o2hb_live_lock);
58a3158a5d Sunil Mushran     2010-12-14  2232  
58a3158a5d Sunil Mushran     2010-12-14  2233  	if (!o2hb_dependent_users)
58a3158a5d Sunil Mushran     2010-12-14  2234  		goto unlock;
58a3158a5d Sunil Mushran     2010-12-14  2235  
a8f70de37b Akinobu Mita      2013-11-12  2236  	if (bitmap_weight(o2hb_quorum_region_bitmap,
58a3158a5d Sunil Mushran     2010-12-14  2237  			   O2NM_MAX_REGIONS) <= O2HB_PIN_CUT_OFF)
58a3158a5d Sunil Mushran     2010-12-14  2238  		o2hb_region_pin(NULL);
58a3158a5d Sunil Mushran     2010-12-14  2239  
58a3158a5d Sunil Mushran     2010-12-14  2240  unlock:
58a3158a5d Sunil Mushran     2010-12-14  2241  	spin_unlock(&o2hb_live_lock);
a7f6a5fb4b Mark Fasheh       2005-12-15  2242  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2243  
33496c3c3d Junxiao Bi        2017-05-03  2244  static ssize_t o2hb_heartbeat_group_dead_threshold_show(struct config_item *item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2245  		char *page)
a7f6a5fb4b Mark Fasheh       2005-12-15  2246  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2247  	return sprintf(page, "%u\n", o2hb_dead_threshold);
a7f6a5fb4b Mark Fasheh       2005-12-15  2248  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2249  
33496c3c3d Junxiao Bi        2017-05-03  2250  static ssize_t o2hb_heartbeat_group_dead_threshold_store(struct config_item *item,
45b997737a Christoph Hellwig 2015-10-03  2251  		const char *page, size_t count)
a7f6a5fb4b Mark Fasheh       2005-12-15  2252  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2253  	unsigned long tmp;
a7f6a5fb4b Mark Fasheh       2005-12-15  2254  	char *p = (char *)page;
a7f6a5fb4b Mark Fasheh       2005-12-15  2255  
a7f6a5fb4b Mark Fasheh       2005-12-15  2256  	tmp = simple_strtoul(p, &p, 10);
a7f6a5fb4b Mark Fasheh       2005-12-15  2257  	if (!p || (*p && (*p != '\n')))
a7f6a5fb4b Mark Fasheh       2005-12-15  2258                  return -EINVAL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2259  
a7f6a5fb4b Mark Fasheh       2005-12-15  2260  	/* this will validate ranges for us. */
a7f6a5fb4b Mark Fasheh       2005-12-15  2261  	o2hb_dead_threshold_set((unsigned int) tmp);
a7f6a5fb4b Mark Fasheh       2005-12-15  2262  
a7f6a5fb4b Mark Fasheh       2005-12-15  2263  	return count;
a7f6a5fb4b Mark Fasheh       2005-12-15  2264  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2265  
45b997737a Christoph Hellwig 2015-10-03  2266  static ssize_t o2hb_heartbeat_group_mode_show(struct config_item *item,
54b5187b5a Sunil Mushran     2010-10-07  2267  		char *page)
54b5187b5a Sunil Mushran     2010-10-07  2268  {
54b5187b5a Sunil Mushran     2010-10-07  2269  	return sprintf(page, "%s\n",
54b5187b5a Sunil Mushran     2010-10-07  2270  		       o2hb_heartbeat_mode_desc[o2hb_heartbeat_mode]);
54b5187b5a Sunil Mushran     2010-10-07  2271  }
54b5187b5a Sunil Mushran     2010-10-07  2272  
45b997737a Christoph Hellwig 2015-10-03  2273  static ssize_t o2hb_heartbeat_group_mode_store(struct config_item *item,
54b5187b5a Sunil Mushran     2010-10-07  2274  		const char *page, size_t count)
54b5187b5a Sunil Mushran     2010-10-07  2275  {
54b5187b5a Sunil Mushran     2010-10-07  2276  	unsigned int i;
54b5187b5a Sunil Mushran     2010-10-07  2277  	int ret;
54b5187b5a Sunil Mushran     2010-10-07  2278  	size_t len;
54b5187b5a Sunil Mushran     2010-10-07  2279  
54b5187b5a Sunil Mushran     2010-10-07  2280  	len = (page[count - 1] == '\n') ? count - 1 : count;
54b5187b5a Sunil Mushran     2010-10-07  2281  	if (!len)
54b5187b5a Sunil Mushran     2010-10-07  2282  		return -EINVAL;
54b5187b5a Sunil Mushran     2010-10-07  2283  
54b5187b5a Sunil Mushran     2010-10-07  2284  	for (i = 0; i < O2HB_HEARTBEAT_NUM_MODES; ++i) {
2bd63329cb Rasmus Villemoes  2014-10-13  2285  		if (strncasecmp(page, o2hb_heartbeat_mode_desc[i], len))
54b5187b5a Sunil Mushran     2010-10-07  2286  			continue;
54b5187b5a Sunil Mushran     2010-10-07  2287  
70f651edb7 Jie Liu           2013-07-03  2288  		ret = o2hb_global_heartbeat_mode_set(i);
54b5187b5a Sunil Mushran     2010-10-07  2289  		if (!ret)
18c50cb0d3 Sunil Mushran     2010-10-06  2290  			printk(KERN_NOTICE "o2hb: Heartbeat mode set to %s\n",
54b5187b5a Sunil Mushran     2010-10-07  2291  			       o2hb_heartbeat_mode_desc[i]);
54b5187b5a Sunil Mushran     2010-10-07  2292  		return count;
54b5187b5a Sunil Mushran     2010-10-07  2293  	}
54b5187b5a Sunil Mushran     2010-10-07  2294  
54b5187b5a Sunil Mushran     2010-10-07  2295  	return -EINVAL;
54b5187b5a Sunil Mushran     2010-10-07  2296  
54b5187b5a Sunil Mushran     2010-10-07  2297  }
54b5187b5a Sunil Mushran     2010-10-07  2298  
33496c3c3d Junxiao Bi        2017-05-03  2299  CONFIGFS_ATTR(o2hb_heartbeat_group_, dead_threshold);
45b997737a Christoph Hellwig 2015-10-03  2300  CONFIGFS_ATTR(o2hb_heartbeat_group_, mode);
54b5187b5a Sunil Mushran     2010-10-07  2301  
a7f6a5fb4b Mark Fasheh       2005-12-15  2302  static struct configfs_attribute *o2hb_heartbeat_group_attrs[] = {
33496c3c3d Junxiao Bi        2017-05-03  2303  	&o2hb_heartbeat_group_attr_dead_threshold,
45b997737a Christoph Hellwig 2015-10-03  2304  	&o2hb_heartbeat_group_attr_mode,
a7f6a5fb4b Mark Fasheh       2005-12-15  2305  	NULL,
a7f6a5fb4b Mark Fasheh       2005-12-15  2306  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2307  
a7f6a5fb4b Mark Fasheh       2005-12-15  2308  static struct configfs_group_operations o2hb_heartbeat_group_group_ops = {
a7f6a5fb4b Mark Fasheh       2005-12-15  2309  	.make_item	= o2hb_heartbeat_group_make_item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2310  	.drop_item	= o2hb_heartbeat_group_drop_item,
a7f6a5fb4b Mark Fasheh       2005-12-15  2311  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2312  
6c56d97a81 Bhumika Goyal     2017-10-12  2313  static const struct config_item_type o2hb_heartbeat_group_type = {
a7f6a5fb4b Mark Fasheh       2005-12-15  2314  	.ct_group_ops	= &o2hb_heartbeat_group_group_ops,
a7f6a5fb4b Mark Fasheh       2005-12-15  2315  	.ct_attrs	= o2hb_heartbeat_group_attrs,
a7f6a5fb4b Mark Fasheh       2005-12-15  2316  	.ct_owner	= THIS_MODULE,
a7f6a5fb4b Mark Fasheh       2005-12-15  2317  };
a7f6a5fb4b Mark Fasheh       2005-12-15  2318  
a7f6a5fb4b Mark Fasheh       2005-12-15  2319  /* this is just here to avoid touching group in heartbeat.h which the
a7f6a5fb4b Mark Fasheh       2005-12-15  2320   * entire damn world #includes */
a7f6a5fb4b Mark Fasheh       2005-12-15  2321  struct config_group *o2hb_alloc_hb_set(void)
a7f6a5fb4b Mark Fasheh       2005-12-15  2322  {
a7f6a5fb4b Mark Fasheh       2005-12-15  2323  	struct o2hb_heartbeat_group *hs = NULL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2324  	struct config_group *ret = NULL;
a7f6a5fb4b Mark Fasheh       2005-12-15  2325  
cd86128088 Robert P. J. Day  2006-12-13  2326  	hs = kzalloc(sizeof(struct o2hb_heartbeat_group), GFP_KERNEL);
a7f6a5fb4b Mark Fasheh       2005-12-15  2327  	if (hs == NULL)
a7f6a5fb4b Mark Fasheh       2005-12-15  2328  		goto out;
a7f6a5fb4b Mark Fasheh       2005-12-15  2329  
a7f6a5fb4b Mark Fasheh       2005-12-15  2330  	config_group_init_type_name(&hs->hs_group, "heartbeat",
a7f6a5fb4b Mark Fasheh       2005-12-15 @2331  				    &o2hb_heartbeat_group_type);
a7f6a5fb4b Mark Fasheh       2005-12-15  2332  
a7f6a5fb4b Mark Fasheh       2005-12-15  2333  	ret = &hs->hs_group;
a7f6a5fb4b Mark Fasheh       2005-12-15  2334  out:
a7f6a5fb4b Mark Fasheh       2005-12-15  2335  	if (ret == NULL)
a7f6a5fb4b Mark Fasheh       2005-12-15  2336  		kfree(hs);
a7f6a5fb4b Mark Fasheh       2005-12-15  2337  	return ret;
a7f6a5fb4b Mark Fasheh       2005-12-15  2338  }
a7f6a5fb4b Mark Fasheh       2005-12-15  2339  

:::::: The code at line 2143 was first introduced by commit
:::::: 536f0741f324f116d8b059295999945a2dac56bc ocfs2/cluster: Track number of global heartbeat regions

:::::: TO: Sunil Mushran <sunil.mushran@oracle.com>
:::::: CC: Sunil Mushran <sunil.mushran@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_kbuild-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=4fT109phFDGTzLoQ_1gyG5rGk7zpX7-tjDNQTcZkrKc&s=0iAysGyxLCP7flEayj1jzxqKNSV-oAvwJucyPl1UwC4&e=                    Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 30338 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20171014/f76bb218/attachment-0001.bin 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] ocfs2/cluster: make config_item_type const
  2017-10-12  8:49 [PATCH] ocfs2/cluster: make config_item_type const Bhumika Goyal
@ 2017-10-14 12:14   ` kbuild test robot
  2017-10-14 12:14   ` [Ocfs2-devel] " kbuild test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2017-10-14 12:14 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: kbuild-all, julia.lawall, mfasheh, jlbec, ocfs2-devel,
	linux-kernel, Bhumika Goyal

[-- Attachment #1: Type: text/plain, Size: 9933 bytes --]

Hi Bhumika,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc4 next-20171013]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bhumika-Goyal/ocfs2-cluster-make-config_item_type-const/20171014-185701
config: tile-allyesconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
   fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
   fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
   fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
   fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
   fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
   fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'

vim +809 fs/ocfs2/cluster/nodemanager.c

0c83ed8e Kurt Hackel       2005-12-15  740  
14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct config_item *item)
14829422 Joel Becker       2007-06-14  742  {
14829422 Joel Becker       2007-06-14 @743  	return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
14829422 Joel Becker       2007-06-14  744  }
14829422 Joel Becker       2007-06-14  745  
14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct config_item *item)
14829422 Joel Becker       2007-06-14  747  {
9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
14829422 Joel Becker       2007-06-14  749  }
14829422 Joel Becker       2007-06-14  750  
16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
16c6a4f2 Joel Becker       2007-06-19  752  {
16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
16c6a4f2 Joel Becker       2007-06-19  755  
16c6a4f2 Joel Becker       2007-06-19  756  	local_node = o2nm_get_node_by_num(o2nm_this_node());
16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
16c6a4f2 Joel Becker       2007-06-19  760  	}
16c6a4f2 Joel Becker       2007-06-19  761  
16c6a4f2 Joel Becker       2007-06-19  762  	ret = o2nm_depend_item(&local_node->nd_item);
16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
16c6a4f2 Joel Becker       2007-06-19  764  
16c6a4f2 Joel Becker       2007-06-19  765  out:
16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
16c6a4f2 Joel Becker       2007-06-19  767  }
16c6a4f2 Joel Becker       2007-06-19  768  
16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
16c6a4f2 Joel Becker       2007-06-19  770  {
16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
16c6a4f2 Joel Becker       2007-06-19  772  
16c6a4f2 Joel Becker       2007-06-19  773  	local_node = o2nm_get_node_by_num(o2nm_this_node());
16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
16c6a4f2 Joel Becker       2007-06-19  775  
16c6a4f2 Joel Becker       2007-06-19  776  	o2nm_undepend_item(&local_node->nd_item);
16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
16c6a4f2 Joel Becker       2007-06-19  778  }
16c6a4f2 Joel Becker       2007-06-19  779  
16c6a4f2 Joel Becker       2007-06-19  780  
0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
0c83ed8e Kurt Hackel       2005-12-15  782  {
0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and shut down hb? */
0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
0c83ed8e Kurt Hackel       2005-12-15  785  	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
0c83ed8e Kurt Hackel       2005-12-15  787  
0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
0c83ed8e Kurt Hackel       2005-12-15  790  }
0c83ed8e Kurt Hackel       2005-12-15  791  
0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
0c83ed8e Kurt Hackel       2005-12-15  793  {
0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
0c83ed8e Kurt Hackel       2005-12-15  795  
87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
2309e9e0 Sunil Mushran     2008-04-14  799  
2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
0c83ed8e Kurt Hackel       2005-12-15  803  
0c83ed8e Kurt Hackel       2005-12-15  804  	ret = o2net_register_hb_callbacks();
0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
0c83ed8e Kurt Hackel       2005-12-15  807  
0c83ed8e Kurt Hackel       2005-12-15  808  	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
e6bd07ae Joel Becker       2007-07-06 @809  	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
0c83ed8e Kurt Hackel       2005-12-15  810  	ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager: Registration returned %d\n", ret);
0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
0c83ed8e Kurt Hackel       2005-12-15  814  	}
0c83ed8e Kurt Hackel       2005-12-15  815  
0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
0c83ed8e Kurt Hackel       2005-12-15  819  
0c83ed8e Kurt Hackel       2005-12-15  820  	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
0c83ed8e Kurt Hackel       2005-12-15  827  out:
0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
0c83ed8e Kurt Hackel       2005-12-15  829  }
0c83ed8e Kurt Hackel       2005-12-15  830  

:::::: The code at line 809 was first introduced by commit
:::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem semaphore to mutex

:::::: TO: Joel Becker <joel.becker@oracle.com>
:::::: CC: Mark Fasheh <mark.fasheh@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50499 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-14 12:14   ` kbuild test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2017-10-14 12:14 UTC (permalink / raw)
  To: ocfs2-devel

Hi Bhumika,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc4 next-20171013]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_linux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_20171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e= 
config: tile-allyesconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.com_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e=  -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
   fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of 'config_item_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:73:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_cluster_group_make_group':
   fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *'
   fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
   fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of 'configfs_depend_item' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
   fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
   fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of 'config_group_init' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:101:13: note: expected 'struct config_group *' but argument is of type 'const struct config_group *'
>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of '__mutex_init' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/mutex.h:133:13: note: expected 'struct mutex *' but argument is of type 'const struct mutex *'
   fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of 'configfs_register_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'
   fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of 'configfs_unregister_subsystem' discards 'const' qualifier from pointer target type [enabled by default]
   include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem *' but argument is of type 'const struct configfs_subsystem *'

vim +809 fs/ocfs2/cluster/nodemanager.c

0c83ed8e Kurt Hackel       2005-12-15  740  
14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct config_item *item)
14829422 Joel Becker       2007-06-14  742  {
14829422 Joel Becker       2007-06-14 @743  	return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
14829422 Joel Becker       2007-06-14  744  }
14829422 Joel Becker       2007-06-14  745  
14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct config_item *item)
14829422 Joel Becker       2007-06-14  747  {
9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
14829422 Joel Becker       2007-06-14  749  }
14829422 Joel Becker       2007-06-14  750  
16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
16c6a4f2 Joel Becker       2007-06-19  752  {
16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
16c6a4f2 Joel Becker       2007-06-19  755  
16c6a4f2 Joel Becker       2007-06-19  756  	local_node = o2nm_get_node_by_num(o2nm_this_node());
16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
16c6a4f2 Joel Becker       2007-06-19  760  	}
16c6a4f2 Joel Becker       2007-06-19  761  
16c6a4f2 Joel Becker       2007-06-19  762  	ret = o2nm_depend_item(&local_node->nd_item);
16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
16c6a4f2 Joel Becker       2007-06-19  764  
16c6a4f2 Joel Becker       2007-06-19  765  out:
16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
16c6a4f2 Joel Becker       2007-06-19  767  }
16c6a4f2 Joel Becker       2007-06-19  768  
16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
16c6a4f2 Joel Becker       2007-06-19  770  {
16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
16c6a4f2 Joel Becker       2007-06-19  772  
16c6a4f2 Joel Becker       2007-06-19  773  	local_node = o2nm_get_node_by_num(o2nm_this_node());
16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
16c6a4f2 Joel Becker       2007-06-19  775  
16c6a4f2 Joel Becker       2007-06-19  776  	o2nm_undepend_item(&local_node->nd_item);
16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
16c6a4f2 Joel Becker       2007-06-19  778  }
16c6a4f2 Joel Becker       2007-06-19  779  
16c6a4f2 Joel Becker       2007-06-19  780  
0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
0c83ed8e Kurt Hackel       2005-12-15  782  {
0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and shut down hb? */
0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
0c83ed8e Kurt Hackel       2005-12-15  785  	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
0c83ed8e Kurt Hackel       2005-12-15  787  
0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
0c83ed8e Kurt Hackel       2005-12-15  790  }
0c83ed8e Kurt Hackel       2005-12-15  791  
0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
0c83ed8e Kurt Hackel       2005-12-15  793  {
0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
0c83ed8e Kurt Hackel       2005-12-15  795  
87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
2309e9e0 Sunil Mushran     2008-04-14  799  
2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
0c83ed8e Kurt Hackel       2005-12-15  803  
0c83ed8e Kurt Hackel       2005-12-15  804  	ret = o2net_register_hb_callbacks();
0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
0c83ed8e Kurt Hackel       2005-12-15  807  
0c83ed8e Kurt Hackel       2005-12-15  808  	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
e6bd07ae Joel Becker       2007-07-06 @809  	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
0c83ed8e Kurt Hackel       2005-12-15  810  	ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager: Registration returned %d\n", ret);
0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
0c83ed8e Kurt Hackel       2005-12-15  814  	}
0c83ed8e Kurt Hackel       2005-12-15  815  
0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
0c83ed8e Kurt Hackel       2005-12-15  819  
0c83ed8e Kurt Hackel       2005-12-15  820  	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
0c83ed8e Kurt Hackel       2005-12-15  827  out:
0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
0c83ed8e Kurt Hackel       2005-12-15  829  }
0c83ed8e Kurt Hackel       2005-12-15  830  

:::::: The code at line 809 was first introduced by commit
:::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem semaphore to mutex

:::::: TO: Joel Becker <joel.becker@oracle.com>
:::::: CC: Mark Fasheh <mark.fasheh@oracle.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_kbuild-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 50499 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20171014/921414da/attachment-0001.bin 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
  2017-10-14 12:14   ` [Ocfs2-devel] " kbuild test robot
@ 2017-10-16  3:26     ` Gang He
  -1 siblings, 0 replies; 11+ messages in thread
From: Gang He @ 2017-10-16  3:26 UTC (permalink / raw)
  To: lkp; +Cc: kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel

Hello Intel Kbuild team,

You just upgrade GCC version when compiling the latest kernel? 
Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.


Thanks
Gang


>>> 
> Hi Bhumika,
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.14-rc4 next-20171013]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:    
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l 
> inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
> 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
> rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
> WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e= 
> config: tile-allyesconfig (attached as .config)
> compiler: tilegx-linux-gcc (GCC) 4.6.2
> reproduce:
>         wget 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c 
> om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
> KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
> bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
> =  -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=tile 
> 
> All warnings (new ones prefixed by >>):
> 
>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of 
> 'config_item_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:73:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c: In function 
> 'o2nm_cluster_group_make_group':
>    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 
> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 
> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
>    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of 
> 'configfs_depend_item' discards 'const' qualifier from pointer target type 
> [enabled by default]
>    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
>    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of 
> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer 
> target type [enabled by default]
>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
>    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of 
> 'config_group_init' discards 'const' qualifier from pointer target type 
> [enabled by default]
>    include/linux/configfs.h:101:13: note: expected 'struct config_group *' 
> but argument is of type 'const struct config_group *'
>>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of 
> '__mutex_init' discards 'const' qualifier from pointer target type [enabled 
> by default]
>    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but 
> argument is of type 'const struct mutex *'
>    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of 
> 'configfs_register_subsystem' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of 
> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer 
> target type [enabled by default]
>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
> 
> vim +809 fs/ocfs2/cluster/nodemanager.c
> 
> 0c83ed8e Kurt Hackel       2005-12-15  740  
> 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct 
> config_item *item)
> 14829422 Joel Becker       2007-06-14  742  {
> 14829422 Joel Becker       2007-06-14 @743  	return 
> configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
> 14829422 Joel Becker       2007-06-14  744  }
> 14829422 Joel Becker       2007-06-14  745  
> 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct 
> config_item *item)
> 14829422 Joel Becker       2007-06-14  747  {
> 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
> 14829422 Joel Becker       2007-06-14  749  }
> 14829422 Joel Becker       2007-06-14  750  
> 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
> 16c6a4f2 Joel Becker       2007-06-19  752  {
> 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
> 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
> 16c6a4f2 Joel Becker       2007-06-19  755  
> 16c6a4f2 Joel Becker       2007-06-19  756  	local_node = 
> o2nm_get_node_by_num(o2nm_this_node());
> 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
> 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
> 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
> 16c6a4f2 Joel Becker       2007-06-19  760  	}
> 16c6a4f2 Joel Becker       2007-06-19  761  
> 16c6a4f2 Joel Becker       2007-06-19  762  	ret = 
> o2nm_depend_item(&local_node->nd_item);
> 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
> 16c6a4f2 Joel Becker       2007-06-19  764  
> 16c6a4f2 Joel Becker       2007-06-19  765  out:
> 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
> 16c6a4f2 Joel Becker       2007-06-19  767  }
> 16c6a4f2 Joel Becker       2007-06-19  768  
> 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
> 16c6a4f2 Joel Becker       2007-06-19  770  {
> 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
> 16c6a4f2 Joel Becker       2007-06-19  772  
> 16c6a4f2 Joel Becker       2007-06-19  773  	local_node = 
> o2nm_get_node_by_num(o2nm_this_node());
> 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
> 16c6a4f2 Joel Becker       2007-06-19  775  
> 16c6a4f2 Joel Becker       2007-06-19  776  
> 	o2nm_undepend_item(&local_node->nd_item);
> 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
> 16c6a4f2 Joel Becker       2007-06-19  778  }
> 16c6a4f2 Joel Becker       2007-06-19  779  
> 16c6a4f2 Joel Becker       2007-06-19  780  
> 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
> 0c83ed8e Kurt Hackel       2005-12-15  782  {
> 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and 
> shut down hb? */
> 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
> 0c83ed8e Kurt Hackel       2005-12-15  785  
> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
> 0c83ed8e Kurt Hackel       2005-12-15  787  
> 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
> 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
> 0c83ed8e Kurt Hackel       2005-12-15  790  }
> 0c83ed8e Kurt Hackel       2005-12-15  791  
> 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
> 0c83ed8e Kurt Hackel       2005-12-15  793  {
> 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
> 0c83ed8e Kurt Hackel       2005-12-15  795  
> 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
> 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
> 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
> 2309e9e0 Sunil Mushran     2008-04-14  799  
> 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
> 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
> 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
> 0c83ed8e Kurt Hackel       2005-12-15  803  
> 0c83ed8e Kurt Hackel       2005-12-15  804  	ret = 
> o2net_register_hb_callbacks();
> 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
> 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
> 0c83ed8e Kurt Hackel       2005-12-15  807  
> 0c83ed8e Kurt Hackel       2005-12-15  808  
> 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
> e6bd07ae Joel Becker       2007-07-06 @809  
> 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
> 0c83ed8e Kurt Hackel       2005-12-15  810  	ret = 
> configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
> 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager: 
> Registration returned %d\n", ret);
> 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
> 0c83ed8e Kurt Hackel       2005-12-15  814  	}
> 0c83ed8e Kurt Hackel       2005-12-15  815  
> 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
> 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
> 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
> 0c83ed8e Kurt Hackel       2005-12-15  819  
> 0c83ed8e Kurt Hackel       2005-12-15  820  
> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
> 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
> 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
> 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
> 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
> 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
> 0c83ed8e Kurt Hackel       2005-12-15  827  out:
> 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
> 0c83ed8e Kurt Hackel       2005-12-15  829  }
> 0c83ed8e Kurt Hackel       2005-12-15  830  
> 
> :::::: The code at line 809 was first introduced by commit
> :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem 
> semaphore to mutex
> 
> :::::: TO: Joel Becker <joel.becker@oracle.com>
> :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k 
> build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
> jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
> =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel 
> Corporation

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-16  3:26     ` Gang He
  0 siblings, 0 replies; 11+ messages in thread
From: Gang He @ 2017-10-16  3:26 UTC (permalink / raw)
  To: lkp; +Cc: kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel

Hello Intel Kbuild team,

You just upgrade GCC version when compiling the latest kernel? 
Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.


Thanks
Gang


>>> 
> Hi Bhumika,
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v4.14-rc4 next-20171013]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:    
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l 
> inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
> 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
> rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
> WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e= 
> config: tile-allyesconfig (attached as .config)
> compiler: tilegx-linux-gcc (GCC) 4.6.2
> reproduce:
>         wget 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c 
> om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
> KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
> bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
> =  -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=tile 
> 
> All warnings (new ones prefixed by >>):
> 
>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of 
> 'config_item_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:73:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c: In function 
> 'o2nm_cluster_group_make_group':
>    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of 
> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of 
> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type 
> *' but argument is of type 'const struct config_item_type *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
>    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of 
> 'configfs_depend_item' discards 'const' qualifier from pointer target type 
> [enabled by default]
>    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
>    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of 
> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer 
> target type [enabled by default]
>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
>    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of 
> 'config_group_init' discards 'const' qualifier from pointer target type 
> [enabled by default]
>    include/linux/configfs.h:101:13: note: expected 'struct config_group *' 
> but argument is of type 'const struct config_group *'
>>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of 
> '__mutex_init' discards 'const' qualifier from pointer target type [enabled 
> by default]
>    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but 
> argument is of type 'const struct mutex *'
>    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of 
> 'configfs_register_subsystem' discards 'const' qualifier from pointer target 
> type [enabled by default]
>    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
>    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of 
> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer 
> target type [enabled by default]
>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem 
> *' but argument is of type 'const struct configfs_subsystem *'
> 
> vim +809 fs/ocfs2/cluster/nodemanager.c
> 
> 0c83ed8e Kurt Hackel       2005-12-15  740  
> 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct 
> config_item *item)
> 14829422 Joel Becker       2007-06-14  742  {
> 14829422 Joel Becker       2007-06-14 @743  	return 
> configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
> 14829422 Joel Becker       2007-06-14  744  }
> 14829422 Joel Becker       2007-06-14  745  
> 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct 
> config_item *item)
> 14829422 Joel Becker       2007-06-14  747  {
> 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
> 14829422 Joel Becker       2007-06-14  749  }
> 14829422 Joel Becker       2007-06-14  750  
> 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
> 16c6a4f2 Joel Becker       2007-06-19  752  {
> 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
> 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
> 16c6a4f2 Joel Becker       2007-06-19  755  
> 16c6a4f2 Joel Becker       2007-06-19  756  	local_node = 
> o2nm_get_node_by_num(o2nm_this_node());
> 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
> 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
> 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
> 16c6a4f2 Joel Becker       2007-06-19  760  	}
> 16c6a4f2 Joel Becker       2007-06-19  761  
> 16c6a4f2 Joel Becker       2007-06-19  762  	ret = 
> o2nm_depend_item(&local_node->nd_item);
> 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
> 16c6a4f2 Joel Becker       2007-06-19  764  
> 16c6a4f2 Joel Becker       2007-06-19  765  out:
> 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
> 16c6a4f2 Joel Becker       2007-06-19  767  }
> 16c6a4f2 Joel Becker       2007-06-19  768  
> 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
> 16c6a4f2 Joel Becker       2007-06-19  770  {
> 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
> 16c6a4f2 Joel Becker       2007-06-19  772  
> 16c6a4f2 Joel Becker       2007-06-19  773  	local_node = 
> o2nm_get_node_by_num(o2nm_this_node());
> 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
> 16c6a4f2 Joel Becker       2007-06-19  775  
> 16c6a4f2 Joel Becker       2007-06-19  776  
> 	o2nm_undepend_item(&local_node->nd_item);
> 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
> 16c6a4f2 Joel Becker       2007-06-19  778  }
> 16c6a4f2 Joel Becker       2007-06-19  779  
> 16c6a4f2 Joel Becker       2007-06-19  780  
> 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
> 0c83ed8e Kurt Hackel       2005-12-15  782  {
> 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and 
> shut down hb? */
> 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
> 0c83ed8e Kurt Hackel       2005-12-15  785  
> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
> 0c83ed8e Kurt Hackel       2005-12-15  787  
> 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
> 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
> 0c83ed8e Kurt Hackel       2005-12-15  790  }
> 0c83ed8e Kurt Hackel       2005-12-15  791  
> 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
> 0c83ed8e Kurt Hackel       2005-12-15  793  {
> 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
> 0c83ed8e Kurt Hackel       2005-12-15  795  
> 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
> 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
> 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
> 2309e9e0 Sunil Mushran     2008-04-14  799  
> 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
> 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
> 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
> 0c83ed8e Kurt Hackel       2005-12-15  803  
> 0c83ed8e Kurt Hackel       2005-12-15  804  	ret = 
> o2net_register_hb_callbacks();
> 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
> 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
> 0c83ed8e Kurt Hackel       2005-12-15  807  
> 0c83ed8e Kurt Hackel       2005-12-15  808  
> 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
> e6bd07ae Joel Becker       2007-07-06 @809  
> 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
> 0c83ed8e Kurt Hackel       2005-12-15  810  	ret = 
> configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
> 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager: 
> Registration returned %d\n", ret);
> 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
> 0c83ed8e Kurt Hackel       2005-12-15  814  	}
> 0c83ed8e Kurt Hackel       2005-12-15  815  
> 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
> 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
> 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
> 0c83ed8e Kurt Hackel       2005-12-15  819  
> 0c83ed8e Kurt Hackel       2005-12-15  820  
> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
> 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
> 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
> 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
> 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
> 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
> 0c83ed8e Kurt Hackel       2005-12-15  827  out:
> 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
> 0c83ed8e Kurt Hackel       2005-12-15  829  }
> 0c83ed8e Kurt Hackel       2005-12-15  830  
> 
> :::::: The code at line 809 was first introduced by commit
> :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem 
> semaphore to mutex
> 
> :::::: TO: Joel Becker <joel.becker@oracle.com>
> :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k 
> build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
> jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
> =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel 
> Corporation

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
  2017-10-16  3:26     ` Gang He
@ 2017-10-16  4:09       ` Fengguang Wu
  -1 siblings, 0 replies; 11+ messages in thread
From: Fengguang Wu @ 2017-10-16  4:09 UTC (permalink / raw)
  To: Gang He; +Cc: kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel

Hi Gang,

On Sun, Oct 15, 2017 at 09:26:00PM -0600, Gang He wrote:
>Hello Intel Kbuild team,
>
>You just upgrade GCC version when compiling the latest kernel?

This report comes from a pretty old gcc:

        config: tile-allyesconfig (attached as .config)
        compiler: tilegx-linux-gcc (GCC) 4.6.2

Thanks,
Fengguang

>Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.
>
>
>Thanks
>Gang
>
>
>>>>
>> Hi Bhumika,
>>
>> [auto build test WARNING on linus/master]
>> [also build test WARNING on v4.14-rc4 next-20171013]
>> [if your patch is applied to the wrong git tree, please drop us a note to
>> help improve the system]
>>
>> url:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l
>> inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
>> 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
>> rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
>> WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e=
>> config: tile-allyesconfig (attached as .config)
>> compiler: tilegx-linux-gcc (GCC) 4.6.2
>> reproduce:
>>         wget
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c
>> om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
>> KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
>> bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
>> =  -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # save the attached .config to linux build tree
>>         make.cross ARCH=tile
>>
>> All warnings (new ones prefixed by >>):
>>
>>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>>    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of
>> 'config_item_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:73:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c: In function
>> 'o2nm_cluster_group_make_group':
>>    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
>>    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of
>> 'configfs_depend_item' discards 'const' qualifier from pointer target type
>> [enabled by default]
>>    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
>>    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of
>> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
>> target type [enabled by default]
>>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
>>    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of
>> 'config_group_init' discards 'const' qualifier from pointer target type
>> [enabled by default]
>>    include/linux/configfs.h:101:13: note: expected 'struct config_group *'
>> but argument is of type 'const struct config_group *'
>>>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of
>> '__mutex_init' discards 'const' qualifier from pointer target type [enabled
>> by default]
>>    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but
>> argument is of type 'const struct mutex *'
>>    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of
>> 'configfs_register_subsystem' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of
>> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
>> target type [enabled by default]
>>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>
>> vim +809 fs/ocfs2/cluster/nodemanager.c
>>
>> 0c83ed8e Kurt Hackel       2005-12-15  740
>> 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct
>> config_item *item)
>> 14829422 Joel Becker       2007-06-14  742  {
>> 14829422 Joel Becker       2007-06-14 @743  	return
>> configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
>> 14829422 Joel Becker       2007-06-14  744  }
>> 14829422 Joel Becker       2007-06-14  745
>> 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct
>> config_item *item)
>> 14829422 Joel Becker       2007-06-14  747  {
>> 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
>> 14829422 Joel Becker       2007-06-14  749  }
>> 14829422 Joel Becker       2007-06-14  750
>> 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
>> 16c6a4f2 Joel Becker       2007-06-19  752  {
>> 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
>> 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
>> 16c6a4f2 Joel Becker       2007-06-19  755
>> 16c6a4f2 Joel Becker       2007-06-19  756  	local_node =
>> o2nm_get_node_by_num(o2nm_this_node());
>> 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
>> 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
>> 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
>> 16c6a4f2 Joel Becker       2007-06-19  760  	}
>> 16c6a4f2 Joel Becker       2007-06-19  761
>> 16c6a4f2 Joel Becker       2007-06-19  762  	ret =
>> o2nm_depend_item(&local_node->nd_item);
>> 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  764
>> 16c6a4f2 Joel Becker       2007-06-19  765  out:
>> 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
>> 16c6a4f2 Joel Becker       2007-06-19  767  }
>> 16c6a4f2 Joel Becker       2007-06-19  768
>> 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
>> 16c6a4f2 Joel Becker       2007-06-19  770  {
>> 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
>> 16c6a4f2 Joel Becker       2007-06-19  772
>> 16c6a4f2 Joel Becker       2007-06-19  773  	local_node =
>> o2nm_get_node_by_num(o2nm_this_node());
>> 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  775
>> 16c6a4f2 Joel Becker       2007-06-19  776
>> 	o2nm_undepend_item(&local_node->nd_item);
>> 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  778  }
>> 16c6a4f2 Joel Becker       2007-06-19  779
>> 16c6a4f2 Joel Becker       2007-06-19  780
>> 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
>> 0c83ed8e Kurt Hackel       2005-12-15  782  {
>> 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and
>> shut down hb? */
>> 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
>> 0c83ed8e Kurt Hackel       2005-12-15  785
>> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
>> 0c83ed8e Kurt Hackel       2005-12-15  787
>> 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
>> 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
>> 0c83ed8e Kurt Hackel       2005-12-15  790  }
>> 0c83ed8e Kurt Hackel       2005-12-15  791
>> 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
>> 0c83ed8e Kurt Hackel       2005-12-15  793  {
>> 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
>> 0c83ed8e Kurt Hackel       2005-12-15  795
>> 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
>> 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
>> 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
>> 2309e9e0 Sunil Mushran     2008-04-14  799
>> 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
>> 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
>> 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
>> 0c83ed8e Kurt Hackel       2005-12-15  803
>> 0c83ed8e Kurt Hackel       2005-12-15  804  	ret =
>> o2net_register_hb_callbacks();
>> 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
>> 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
>> 0c83ed8e Kurt Hackel       2005-12-15  807
>> 0c83ed8e Kurt Hackel       2005-12-15  808
>> 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
>> e6bd07ae Joel Becker       2007-07-06 @809
>> 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
>> 0c83ed8e Kurt Hackel       2005-12-15  810  	ret =
>> configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
>> 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager:
>> Registration returned %d\n", ret);
>> 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
>> 0c83ed8e Kurt Hackel       2005-12-15  814  	}
>> 0c83ed8e Kurt Hackel       2005-12-15  815
>> 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
>> 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
>> 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
>> 0c83ed8e Kurt Hackel       2005-12-15  819
>> 0c83ed8e Kurt Hackel       2005-12-15  820
>> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
>> 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
>> 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
>> 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
>> 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
>> 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
>> 0c83ed8e Kurt Hackel       2005-12-15  827  out:
>> 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
>> 0c83ed8e Kurt Hackel       2005-12-15  829  }
>> 0c83ed8e Kurt Hackel       2005-12-15  830
>>
>> :::::: The code at line 809 was first introduced by commit
>> :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem
>> semaphore to mutex
>>
>> :::::: TO: Joel Becker <joel.becker@oracle.com>
>> :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k
>> build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
>> jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
>> =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel
>> Corporation
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-16  4:09       ` Fengguang Wu
  0 siblings, 0 replies; 11+ messages in thread
From: Fengguang Wu @ 2017-10-16  4:09 UTC (permalink / raw)
  To: Gang He; +Cc: kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel

Hi Gang,

On Sun, Oct 15, 2017 at 09:26:00PM -0600, Gang He wrote:
>Hello Intel Kbuild team,
>
>You just upgrade GCC version when compiling the latest kernel?

This report comes from a pretty old gcc:

        config: tile-allyesconfig (attached as .config)
        compiler: tilegx-linux-gcc (GCC) 4.6.2

Thanks,
Fengguang

>Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.
>
>
>Thanks
>Gang
>
>
>>>>
>> Hi Bhumika,
>>
>> [auto build test WARNING on linus/master]
>> [also build test WARNING on v4.14-rc4 next-20171013]
>> [if your patch is applied to the wrong git tree, please drop us a note to
>> help improve the system]
>>
>> url:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l
>> inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
>> 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
>> rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
>> WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e=
>> config: tile-allyesconfig (attached as .config)
>> compiler: tilegx-linux-gcc (GCC) 4.6.2
>> reproduce:
>>         wget
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c
>> om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
>> KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
>> bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
>> =  -O ~/bin/make.cross
>>         chmod +x ~/bin/make.cross
>>         # save the attached .config to linux build tree
>>         make.cross ARCH=tile
>>
>> All warnings (new ones prefixed by >>):
>>
>>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
>>    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of
>> 'config_item_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:73:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c: In function
>> 'o2nm_cluster_group_make_group':
>>    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
>> *' but argument is of type 'const struct config_item_type *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
>>    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of
>> 'configfs_depend_item' discards 'const' qualifier from pointer target type
>> [enabled by default]
>>    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
>>    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of
>> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
>> target type [enabled by default]
>>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
>>    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of
>> 'config_group_init' discards 'const' qualifier from pointer target type
>> [enabled by default]
>>    include/linux/configfs.h:101:13: note: expected 'struct config_group *'
>> but argument is of type 'const struct config_group *'
>>>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of
>> '__mutex_init' discards 'const' qualifier from pointer target type [enabled
>> by default]
>>    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but
>> argument is of type 'const struct mutex *'
>>    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of
>> 'configfs_register_subsystem' discards 'const' qualifier from pointer target
>> type [enabled by default]
>>    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of
>> 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
>> target type [enabled by default]
>>    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
>> *' but argument is of type 'const struct configfs_subsystem *'
>>
>> vim +809 fs/ocfs2/cluster/nodemanager.c
>>
>> 0c83ed8e Kurt Hackel       2005-12-15  740
>> 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct
>> config_item *item)
>> 14829422 Joel Becker       2007-06-14  742  {
>> 14829422 Joel Becker       2007-06-14 @743  	return
>> configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
>> 14829422 Joel Becker       2007-06-14  744  }
>> 14829422 Joel Becker       2007-06-14  745
>> 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct
>> config_item *item)
>> 14829422 Joel Becker       2007-06-14  747  {
>> 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
>> 14829422 Joel Becker       2007-06-14  749  }
>> 14829422 Joel Becker       2007-06-14  750
>> 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
>> 16c6a4f2 Joel Becker       2007-06-19  752  {
>> 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
>> 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
>> 16c6a4f2 Joel Becker       2007-06-19  755
>> 16c6a4f2 Joel Becker       2007-06-19  756  	local_node =
>> o2nm_get_node_by_num(o2nm_this_node());
>> 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
>> 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
>> 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
>> 16c6a4f2 Joel Becker       2007-06-19  760  	}
>> 16c6a4f2 Joel Becker       2007-06-19  761
>> 16c6a4f2 Joel Becker       2007-06-19  762  	ret =
>> o2nm_depend_item(&local_node->nd_item);
>> 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  764
>> 16c6a4f2 Joel Becker       2007-06-19  765  out:
>> 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
>> 16c6a4f2 Joel Becker       2007-06-19  767  }
>> 16c6a4f2 Joel Becker       2007-06-19  768
>> 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
>> 16c6a4f2 Joel Becker       2007-06-19  770  {
>> 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
>> 16c6a4f2 Joel Becker       2007-06-19  772
>> 16c6a4f2 Joel Becker       2007-06-19  773  	local_node =
>> o2nm_get_node_by_num(o2nm_this_node());
>> 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  775
>> 16c6a4f2 Joel Becker       2007-06-19  776
>> 	o2nm_undepend_item(&local_node->nd_item);
>> 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
>> 16c6a4f2 Joel Becker       2007-06-19  778  }
>> 16c6a4f2 Joel Becker       2007-06-19  779
>> 16c6a4f2 Joel Becker       2007-06-19  780
>> 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
>> 0c83ed8e Kurt Hackel       2005-12-15  782  {
>> 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and
>> shut down hb? */
>> 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
>> 0c83ed8e Kurt Hackel       2005-12-15  785
>> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
>> 0c83ed8e Kurt Hackel       2005-12-15  787
>> 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
>> 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
>> 0c83ed8e Kurt Hackel       2005-12-15  790  }
>> 0c83ed8e Kurt Hackel       2005-12-15  791
>> 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
>> 0c83ed8e Kurt Hackel       2005-12-15  793  {
>> 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
>> 0c83ed8e Kurt Hackel       2005-12-15  795
>> 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
>> 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
>> 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
>> 2309e9e0 Sunil Mushran     2008-04-14  799
>> 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
>> 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
>> 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
>> 0c83ed8e Kurt Hackel       2005-12-15  803
>> 0c83ed8e Kurt Hackel       2005-12-15  804  	ret =
>> o2net_register_hb_callbacks();
>> 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
>> 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
>> 0c83ed8e Kurt Hackel       2005-12-15  807
>> 0c83ed8e Kurt Hackel       2005-12-15  808
>> 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
>> e6bd07ae Joel Becker       2007-07-06 @809
>> 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
>> 0c83ed8e Kurt Hackel       2005-12-15  810  	ret =
>> configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
>> 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager:
>> Registration returned %d\n", ret);
>> 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
>> 0c83ed8e Kurt Hackel       2005-12-15  814  	}
>> 0c83ed8e Kurt Hackel       2005-12-15  815
>> 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
>> 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
>> 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
>> 0c83ed8e Kurt Hackel       2005-12-15  819
>> 0c83ed8e Kurt Hackel       2005-12-15  820
>> 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
>> 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
>> 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
>> 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
>> 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
>> 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
>> 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
>> 0c83ed8e Kurt Hackel       2005-12-15  827  out:
>> 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
>> 0c83ed8e Kurt Hackel       2005-12-15  829  }
>> 0c83ed8e Kurt Hackel       2005-12-15  830
>>
>> :::::: The code at line 809 was first introduced by commit
>> :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem
>> semaphore to mutex
>>
>> :::::: TO: Joel Becker <joel.becker@oracle.com>
>> :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k
>> build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
>> jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
>> =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel
>> Corporation
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
  2017-10-16  3:26     ` Gang He
@ 2017-10-16  5:48       ` Julia Lawall
  -1 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-10-16  5:48 UTC (permalink / raw)
  To: Gang He
  Cc: lkp, kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel



On Sun, 15 Oct 2017, Gang He wrote:

> Hello Intel Kbuild team,
>
> You just upgrade GCC version when compiling the latest kernel?
> Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.

I'm not sure to understand the comment.  The report is due to the fact
that Bhumika's patch depends on other patches that have not been applied
yet.

julia


>
>
> Thanks
> Gang
>
>
> >>>
> > Hi Bhumika,
> >
> > [auto build test WARNING on linus/master]
> > [also build test WARNING on v4.14-rc4 next-20171013]
> > [if your patch is applied to the wrong git tree, please drop us a note to
> > help improve the system]
> >
> > url:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l
> > inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
> > 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
> > rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
> > WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e=
> > config: tile-allyesconfig (attached as .config)
> > compiler: tilegx-linux-gcc (GCC) 4.6.2
> > reproduce:
> >         wget
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c
> > om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
> > KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
> > bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
> > =  -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=tile
> >
> > All warnings (new ones prefixed by >>):
> >
> >    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
> >    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of
> > 'config_item_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:73:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c: In function
> > 'o2nm_cluster_group_make_group':
> >    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of
> > 'config_group_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of
> > 'config_group_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
> >    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of
> > 'configfs_depend_item' discards 'const' qualifier from pointer target type
> > [enabled by default]
> >    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
> >    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of
> > 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
> > target type [enabled by default]
> >    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
> >    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of
> > 'config_group_init' discards 'const' qualifier from pointer target type
> > [enabled by default]
> >    include/linux/configfs.h:101:13: note: expected 'struct config_group *'
> > but argument is of type 'const struct config_group *'
> >>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of
> > '__mutex_init' discards 'const' qualifier from pointer target type [enabled
> > by default]
> >    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but
> > argument is of type 'const struct mutex *'
> >    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of
> > 'configfs_register_subsystem' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of
> > 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
> > target type [enabled by default]
> >    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >
> > vim +809 fs/ocfs2/cluster/nodemanager.c
> >
> > 0c83ed8e Kurt Hackel       2005-12-15  740
> > 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct
> > config_item *item)
> > 14829422 Joel Becker       2007-06-14  742  {
> > 14829422 Joel Becker       2007-06-14 @743  	return
> > configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
> > 14829422 Joel Becker       2007-06-14  744  }
> > 14829422 Joel Becker       2007-06-14  745
> > 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct
> > config_item *item)
> > 14829422 Joel Becker       2007-06-14  747  {
> > 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
> > 14829422 Joel Becker       2007-06-14  749  }
> > 14829422 Joel Becker       2007-06-14  750
> > 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
> > 16c6a4f2 Joel Becker       2007-06-19  752  {
> > 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
> > 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
> > 16c6a4f2 Joel Becker       2007-06-19  755
> > 16c6a4f2 Joel Becker       2007-06-19  756  	local_node =
> > o2nm_get_node_by_num(o2nm_this_node());
> > 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
> > 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
> > 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
> > 16c6a4f2 Joel Becker       2007-06-19  760  	}
> > 16c6a4f2 Joel Becker       2007-06-19  761
> > 16c6a4f2 Joel Becker       2007-06-19  762  	ret =
> > o2nm_depend_item(&local_node->nd_item);
> > 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  764
> > 16c6a4f2 Joel Becker       2007-06-19  765  out:
> > 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
> > 16c6a4f2 Joel Becker       2007-06-19  767  }
> > 16c6a4f2 Joel Becker       2007-06-19  768
> > 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
> > 16c6a4f2 Joel Becker       2007-06-19  770  {
> > 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
> > 16c6a4f2 Joel Becker       2007-06-19  772
> > 16c6a4f2 Joel Becker       2007-06-19  773  	local_node =
> > o2nm_get_node_by_num(o2nm_this_node());
> > 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  775
> > 16c6a4f2 Joel Becker       2007-06-19  776
> > 	o2nm_undepend_item(&local_node->nd_item);
> > 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  778  }
> > 16c6a4f2 Joel Becker       2007-06-19  779
> > 16c6a4f2 Joel Becker       2007-06-19  780
> > 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
> > 0c83ed8e Kurt Hackel       2005-12-15  782  {
> > 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and
> > shut down hb? */
> > 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
> > 0c83ed8e Kurt Hackel       2005-12-15  785
> > 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
> > 0c83ed8e Kurt Hackel       2005-12-15  787
> > 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
> > 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
> > 0c83ed8e Kurt Hackel       2005-12-15  790  }
> > 0c83ed8e Kurt Hackel       2005-12-15  791
> > 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
> > 0c83ed8e Kurt Hackel       2005-12-15  793  {
> > 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
> > 0c83ed8e Kurt Hackel       2005-12-15  795
> > 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
> > 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
> > 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
> > 2309e9e0 Sunil Mushran     2008-04-14  799
> > 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
> > 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
> > 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
> > 0c83ed8e Kurt Hackel       2005-12-15  803
> > 0c83ed8e Kurt Hackel       2005-12-15  804  	ret =
> > o2net_register_hb_callbacks();
> > 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
> > 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
> > 0c83ed8e Kurt Hackel       2005-12-15  807
> > 0c83ed8e Kurt Hackel       2005-12-15  808
> > 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
> > e6bd07ae Joel Becker       2007-07-06 @809
> > 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
> > 0c83ed8e Kurt Hackel       2005-12-15  810  	ret =
> > configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
> > 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager:
> > Registration returned %d\n", ret);
> > 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
> > 0c83ed8e Kurt Hackel       2005-12-15  814  	}
> > 0c83ed8e Kurt Hackel       2005-12-15  815
> > 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
> > 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
> > 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
> > 0c83ed8e Kurt Hackel       2005-12-15  819
> > 0c83ed8e Kurt Hackel       2005-12-15  820
> > 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
> > 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
> > 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
> > 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
> > 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
> > 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
> > 0c83ed8e Kurt Hackel       2005-12-15  827  out:
> > 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
> > 0c83ed8e Kurt Hackel       2005-12-15  829  }
> > 0c83ed8e Kurt Hackel       2005-12-15  830
> >
> > :::::: The code at line 809 was first introduced by commit
> > :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem
> > semaphore to mutex
> >
> > :::::: TO: Joel Becker <joel.becker@oracle.com>
> > :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
> >
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k
> > build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
> > jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
> > =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel
> > Corporation
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/cluster: make config_item_type const
@ 2017-10-16  5:48       ` Julia Lawall
  0 siblings, 0 replies; 11+ messages in thread
From: Julia Lawall @ 2017-10-16  5:48 UTC (permalink / raw)
  To: Gang He
  Cc: lkp, kbuild-all, bhumirks, julia.lawall, ocfs2-devel, linux-kernel



On Sun, 15 Oct 2017, Gang He wrote:

> Hello Intel Kbuild team,
>
> You just upgrade GCC version when compiling the latest kernel?
> Since these code looks a little old, I am sure that the related contributors are still work on OCFS2 project.

I'm not sure to understand the comment.  The report is due to the fact
that Bhumika's patch depends on other patches that have not been applied
yet.

julia


>
>
> Thanks
> Gang
>
>
> >>>
> > Hi Bhumika,
> >
> > [auto build test WARNING on linus/master]
> > [also build test WARNING on v4.14-rc4 next-20171013]
> > [if your patch is applied to the wrong git tree, please drop us a note to
> > help improve the system]
> >
> > url:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_l
> > inux_commits_Bhumika-2DGoyal_ocfs2-2Dcluster-2Dmake-2Dconfig-5Fitem-5Ftype-2Dconst_2
> > 0171014-2D185701&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmG
> > rYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1
> > WB7E&s=hFVfDC8STTMTIDNtdipf8BlwR_V8RJG6an_l-r9MKyA&e=
> > config: tile-allyesconfig (attached as .config)
> > compiler: tilegx-linux-gcc (GCC) 4.6.2
> > reproduce:
> >         wget
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__raw.githubusercontent.c
> > om_intel_lkp-2Dtests_master_sbin_make.cross&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxB
> > KCX5YTpkKY057SbK10&r=f4ohdmGrYxZejY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrj
> > bR5Spv4mvmdj2s377WohnG6h6z1WB7E&s=f5lUGF9NCtygTaG6AR0HkjhG7fOwD5nKFLaYCvPpju0&e
> > =  -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=tile
> >
> > All warnings (new ones prefixed by >>):
> >
> >    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_node_group_make_item':
> >    fs/ocfs2/cluster/nodemanager.c:573:2: warning: passing argument 3 of
> > 'config_item_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:73:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c: In function
> > 'o2nm_cluster_group_make_group':
> >    fs/ocfs2/cluster/nodemanager.c:681:9: warning: passing argument 3 of
> > 'config_group_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c:685:9: warning: passing argument 3 of
> > 'config_group_init_type_name' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:102:13: note: expected 'struct config_item_type
> > *' but argument is of type 'const struct config_item_type *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'o2nm_depend_item':
> >    fs/ocfs2/cluster/nodemanager.c:743:2: warning: passing argument 1 of
> > 'configfs_depend_item' discards 'const' qualifier from pointer target type
> > [enabled by default]
> >    include/linux/configfs.h:269:5: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'exit_o2nm':
> >    fs/ocfs2/cluster/nodemanager.c:785:2: warning: passing argument 1 of
> > 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
> > target type [enabled by default]
> >    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c: In function 'init_o2nm':
> >    fs/ocfs2/cluster/nodemanager.c:808:2: warning: passing argument 1 of
> > 'config_group_init' discards 'const' qualifier from pointer target type
> > [enabled by default]
> >    include/linux/configfs.h:101:13: note: expected 'struct config_group *'
> > but argument is of type 'const struct config_group *'
> >>> fs/ocfs2/cluster/nodemanager.c:809:2: warning: passing argument 1 of
> > '__mutex_init' discards 'const' qualifier from pointer target type [enabled
> > by default]
> >    include/linux/mutex.h:133:13: note: expected 'struct mutex *' but
> > argument is of type 'const struct mutex *'
> >    fs/ocfs2/cluster/nodemanager.c:810:2: warning: passing argument 1 of
> > 'configfs_register_subsystem' discards 'const' qualifier from pointer target
> > type [enabled by default]
> >    include/linux/configfs.h:252:5: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >    fs/ocfs2/cluster/nodemanager.c:820:2: warning: passing argument 1 of
> > 'configfs_unregister_subsystem' discards 'const' qualifier from pointer
> > target type [enabled by default]
> >    include/linux/configfs.h:253:6: note: expected 'struct configfs_subsystem
> > *' but argument is of type 'const struct configfs_subsystem *'
> >
> > vim +809 fs/ocfs2/cluster/nodemanager.c
> >
> > 0c83ed8e Kurt Hackel       2005-12-15  740
> > 14829422 Joel Becker       2007-06-14  741  int o2nm_depend_item(struct
> > config_item *item)
> > 14829422 Joel Becker       2007-06-14  742  {
> > 14829422 Joel Becker       2007-06-14 @743  	return
> > configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
> > 14829422 Joel Becker       2007-06-14  744  }
> > 14829422 Joel Becker       2007-06-14  745
> > 14829422 Joel Becker       2007-06-14  746  void o2nm_undepend_item(struct
> > config_item *item)
> > 14829422 Joel Becker       2007-06-14  747  {
> > 9a9e3415 Krzysztof Opasiak 2015-12-11  748  	configfs_undepend_item(item);
> > 14829422 Joel Becker       2007-06-14  749  }
> > 14829422 Joel Becker       2007-06-14  750
> > 16c6a4f2 Joel Becker       2007-06-19  751  int o2nm_depend_this_node(void)
> > 16c6a4f2 Joel Becker       2007-06-19  752  {
> > 16c6a4f2 Joel Becker       2007-06-19  753  	int ret = 0;
> > 16c6a4f2 Joel Becker       2007-06-19  754  	struct o2nm_node *local_node;
> > 16c6a4f2 Joel Becker       2007-06-19  755
> > 16c6a4f2 Joel Becker       2007-06-19  756  	local_node =
> > o2nm_get_node_by_num(o2nm_this_node());
> > 16c6a4f2 Joel Becker       2007-06-19  757  	if (!local_node) {
> > 16c6a4f2 Joel Becker       2007-06-19  758  		ret = -EINVAL;
> > 16c6a4f2 Joel Becker       2007-06-19  759  		goto out;
> > 16c6a4f2 Joel Becker       2007-06-19  760  	}
> > 16c6a4f2 Joel Becker       2007-06-19  761
> > 16c6a4f2 Joel Becker       2007-06-19  762  	ret =
> > o2nm_depend_item(&local_node->nd_item);
> > 16c6a4f2 Joel Becker       2007-06-19  763  	o2nm_node_put(local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  764
> > 16c6a4f2 Joel Becker       2007-06-19  765  out:
> > 16c6a4f2 Joel Becker       2007-06-19  766  	return ret;
> > 16c6a4f2 Joel Becker       2007-06-19  767  }
> > 16c6a4f2 Joel Becker       2007-06-19  768
> > 16c6a4f2 Joel Becker       2007-06-19  769  void o2nm_undepend_this_node(void)
> > 16c6a4f2 Joel Becker       2007-06-19  770  {
> > 16c6a4f2 Joel Becker       2007-06-19  771  	struct o2nm_node *local_node;
> > 16c6a4f2 Joel Becker       2007-06-19  772
> > 16c6a4f2 Joel Becker       2007-06-19  773  	local_node =
> > o2nm_get_node_by_num(o2nm_this_node());
> > 16c6a4f2 Joel Becker       2007-06-19  774  	BUG_ON(!local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  775
> > 16c6a4f2 Joel Becker       2007-06-19  776
> > 	o2nm_undepend_item(&local_node->nd_item);
> > 16c6a4f2 Joel Becker       2007-06-19  777  	o2nm_node_put(local_node);
> > 16c6a4f2 Joel Becker       2007-06-19  778  }
> > 16c6a4f2 Joel Becker       2007-06-19  779
> > 16c6a4f2 Joel Becker       2007-06-19  780
> > 0c83ed8e Kurt Hackel       2005-12-15  781  static void __exit exit_o2nm(void)
> > 0c83ed8e Kurt Hackel       2005-12-15  782  {
> > 0c83ed8e Kurt Hackel       2005-12-15  783  	/* XXX sync with hb callbacks and
> > shut down hb? */
> > 0c83ed8e Kurt Hackel       2005-12-15  784  	o2net_unregister_hb_callbacks();
> > 0c83ed8e Kurt Hackel       2005-12-15  785
> > 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  786  	o2cb_sys_shutdown();
> > 0c83ed8e Kurt Hackel       2005-12-15  787
> > 0c83ed8e Kurt Hackel       2005-12-15  788  	o2net_exit();
> > 87d3d3f3 Sunil Mushran     2008-12-17  789  	o2hb_exit();
> > 0c83ed8e Kurt Hackel       2005-12-15  790  }
> > 0c83ed8e Kurt Hackel       2005-12-15  791
> > 0c83ed8e Kurt Hackel       2005-12-15  792  static int __init init_o2nm(void)
> > 0c83ed8e Kurt Hackel       2005-12-15  793  {
> > 0c83ed8e Kurt Hackel       2005-12-15  794  	int ret = -1;
> > 0c83ed8e Kurt Hackel       2005-12-15  795
> > 87d3d3f3 Sunil Mushran     2008-12-17  796  	ret = o2hb_init();
> > 87d3d3f3 Sunil Mushran     2008-12-17  797  	if (ret)
> > 87d3d3f3 Sunil Mushran     2008-12-17  798  		goto out;
> > 2309e9e0 Sunil Mushran     2008-04-14  799
> > 2309e9e0 Sunil Mushran     2008-04-14  800  	ret = o2net_init();
> > 2309e9e0 Sunil Mushran     2008-04-14  801  	if (ret)
> > 87d3d3f3 Sunil Mushran     2008-12-17  802  		goto out_o2hb;
> > 0c83ed8e Kurt Hackel       2005-12-15  803
> > 0c83ed8e Kurt Hackel       2005-12-15  804  	ret =
> > o2net_register_hb_callbacks();
> > 0c83ed8e Kurt Hackel       2005-12-15  805  	if (ret)
> > 3878f110 Joel Becker       2008-05-30  806  		goto out_o2net;
> > 0c83ed8e Kurt Hackel       2005-12-15  807
> > 0c83ed8e Kurt Hackel       2005-12-15  808
> > 	config_group_init(&o2nm_cluster_group.cs_subsys.su_group);
> > e6bd07ae Joel Becker       2007-07-06 @809
> > 	mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex);
> > 0c83ed8e Kurt Hackel       2005-12-15  810  	ret =
> > configfs_register_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  811  	if (ret) {
> > 0c83ed8e Kurt Hackel       2005-12-15  812  		printk(KERN_ERR "nodemanager:
> > Registration returned %d\n", ret);
> > 0c83ed8e Kurt Hackel       2005-12-15  813  		goto out_callbacks;
> > 0c83ed8e Kurt Hackel       2005-12-15  814  	}
> > 0c83ed8e Kurt Hackel       2005-12-15  815
> > 0c83ed8e Kurt Hackel       2005-12-15  816  	ret = o2cb_sys_init();
> > 0c83ed8e Kurt Hackel       2005-12-15  817  	if (!ret)
> > 0c83ed8e Kurt Hackel       2005-12-15  818  		goto out;
> > 0c83ed8e Kurt Hackel       2005-12-15  819
> > 0c83ed8e Kurt Hackel       2005-12-15  820
> > 	configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
> > 0c83ed8e Kurt Hackel       2005-12-15  821  out_callbacks:
> > 0c83ed8e Kurt Hackel       2005-12-15  822  	o2net_unregister_hb_callbacks();
> > 895928b8 Jeff Mahoney      2006-02-21  823  out_o2net:
> > 895928b8 Jeff Mahoney      2006-02-21  824  	o2net_exit();
> > 87d3d3f3 Sunil Mushran     2008-12-17  825  out_o2hb:
> > 87d3d3f3 Sunil Mushran     2008-12-17  826  	o2hb_exit();
> > 0c83ed8e Kurt Hackel       2005-12-15  827  out:
> > 0c83ed8e Kurt Hackel       2005-12-15  828  	return ret;
> > 0c83ed8e Kurt Hackel       2005-12-15  829  }
> > 0c83ed8e Kurt Hackel       2005-12-15  830
> >
> > :::::: The code at line 809 was first introduced by commit
> > :::::: e6bd07aee739566803425acdbf5cdb29919164e1 configfs: Convert subsystem
> > semaphore to mutex
> >
> > :::::: TO: Joel Becker <joel.becker@oracle.com>
> > :::::: CC: Mark Fasheh <mark.fasheh@oracle.com>
> >
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_pipermail_k
> > build-2Dall&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=f4ohdmGrYxZe
> > jY77yzx3eNgTHb1ZAfZytktjHqNVzc8&m=8Ca3nktkbfrjbR5Spv4mvmdj2s377WohnG6h6z1WB7E&s
> > =nLlW0xEmimMcnOene83E4zhz60ab1-1iXKtP_w_e8cQ&e=                    Intel
> > Corporation
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-16  5:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12  8:49 [PATCH] ocfs2/cluster: make config_item_type const Bhumika Goyal
2017-10-14 11:50 ` kbuild test robot
2017-10-14 11:50   ` [Ocfs2-devel] " kbuild test robot
2017-10-14 12:14 ` kbuild test robot
2017-10-14 12:14   ` [Ocfs2-devel] " kbuild test robot
2017-10-16  3:26   ` Gang He
2017-10-16  3:26     ` Gang He
2017-10-16  4:09     ` Fengguang Wu
2017-10-16  4:09       ` Fengguang Wu
2017-10-16  5:48     ` Julia Lawall
2017-10-16  5:48       ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.