tree:   https://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git 
next
head:   0c6f1abae81dec18eeb9df1ba3d3d2d7dd48d9c7
commit: 0c6f1abae81dec18eeb9df1ba3d3d2d7dd48d9c7 [21/21] dlm: make 
config_item_type const
config: i386-randconfig-x071-201741 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 0c6f1abae81dec18eeb9df1ba3d3d2d7dd48d9c7
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   fs/dlm/config.c: In function 'make_cluster':
>> fs/dlm/config.c:358:48: warning: passing argument 3 of 
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
>> type [-Wdiscarded-qualifiers]
     config_group_init_type_name(&cl->group, name, &cluster_type);
                                                   ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c:359:56: warning: passing argument 3 of 
'config_group_init_type_name' discards 'const' qualifier from pointer target 
type [-Wdiscarded-qualifiers]
     config_group_init_type_name(&sps->ss_group, "spaces", &spaces_type);
                                                           ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c:360:55: warning: passing argument 3 of 
'config_group_init_type_name' discards 'const' qualifier from pointer target 
type [-Wdiscarded-qualifiers]
     config_group_init_type_name(&cms->cs_group, "comms", &comms_type);
                                                          ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c: In function 'make_space':
   fs/dlm/config.c:421:48: warning: passing argument 3 of 
'config_group_init_type_name' discards 'const' qualifier from pointer target 
type [-Wdiscarded-qualifiers]
     config_group_init_type_name(&sp->group, name, &space_type);
                                                   ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c:423:55: warning: passing argument 3 of 
'config_group_init_type_name' discards 'const' qualifier from pointer target 
type [-Wdiscarded-qualifiers]
     config_group_init_type_name(&nds->ns_group, "nodes", &nodes_type);
                                                          ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c: In function 'make_comm':
>> fs/dlm/config.c:461:46: warning: passing argument 3 of 
>> 'config_item_init_type_name' discards 'const' qualifier from pointer target 
>> type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&cm->item, name, &comm_type);
                                                 ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c: In function 'make_node':
   fs/dlm/config.c:499:46: warning: passing argument 3 of 
'config_item_init_type_name' discards 'const' qualifier from pointer target 
type [-Wdiscarded-qualifiers]
     config_item_init_type_name(&nd->item, name, &node_type);
                                                 ^
   In file included from fs/dlm/config.c:16: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/dlm/config.c: At top level:
>> fs/dlm/config.c:536:16: warning: initialization discards 'const' qualifier 
>> from pointer target type [-Wdiscarded-qualifiers]
        .ci_type = &clusters_type,
                   ^

vim +358 fs/dlm/config.c

e7fd4179 David Teigland    2006-01-18  343  
f89ab861 Joel Becker       2008-07-17  344  static struct config_group 
*make_cluster(struct config_group *g,
f89ab861 Joel Becker       2008-07-17  345                                      
 const char *name)
e7fd4179 David Teigland    2006-01-18  346  {
51409340 David Teigland    2008-07-31  347      struct dlm_cluster *cl = NULL;
51409340 David Teigland    2008-07-31  348      struct dlm_spaces *sps = NULL;
51409340 David Teigland    2008-07-31  349      struct dlm_comms *cms = NULL;
e7fd4179 David Teigland    2006-01-18  350  
573c24c4 David Teigland    2009-11-30  351      cl = kzalloc(sizeof(struct 
dlm_cluster), GFP_NOFS);
573c24c4 David Teigland    2009-11-30  352      sps = kzalloc(sizeof(struct 
dlm_spaces), GFP_NOFS);
573c24c4 David Teigland    2009-11-30  353      cms = kzalloc(sizeof(struct 
dlm_comms), GFP_NOFS);
e7fd4179 David Teigland    2006-01-18  354  
82c7d823 Andrew Price      2016-03-22  355      if (!cl || !sps || !cms)
e7fd4179 David Teigland    2006-01-18  356              goto fail;
e7fd4179 David Teigland    2006-01-18  357  
e7fd4179 David Teigland    2006-01-18 @358      
config_group_init_type_name(&cl->group, name, &cluster_type);
e7fd4179 David Teigland    2006-01-18  359      
config_group_init_type_name(&sps->ss_group, "spaces", &spaces_type);
e7fd4179 David Teigland    2006-01-18  360      
config_group_init_type_name(&cms->cs_group, "comms", &comms_type);
e7fd4179 David Teigland    2006-01-18  361  
1ae1602d Christoph Hellwig 2016-02-26  362      
configfs_add_default_group(&sps->ss_group, &cl->group);
1ae1602d Christoph Hellwig 2016-02-26  363      
configfs_add_default_group(&cms->cs_group, &cl->group);
e7fd4179 David Teigland    2006-01-18  364  
d200778e David Teigland    2007-01-09  365      cl->cl_tcp_port = 
dlm_config.ci_tcp_port;
d200778e David Teigland    2007-01-09  366      cl->cl_buffer_size = 
dlm_config.ci_buffer_size;
d200778e David Teigland    2007-01-09  367      cl->cl_rsbtbl_size = 
dlm_config.ci_rsbtbl_size;
d200778e David Teigland    2007-01-09  368      cl->cl_recover_timer = 
dlm_config.ci_recover_timer;
d200778e David Teigland    2007-01-09  369      cl->cl_toss_secs = 
dlm_config.ci_toss_secs;
d200778e David Teigland    2007-01-09  370      cl->cl_scan_secs = 
dlm_config.ci_scan_secs;
d200778e David Teigland    2007-01-09  371      cl->cl_log_debug = 
dlm_config.ci_log_debug;
505ee528 Zhilong Liu       2016-06-19  372      cl->cl_log_info = 
dlm_config.ci_log_info;
0b7cac0f David Teigland    2007-05-29  373      cl->cl_protocol = 
dlm_config.ci_protocol;
84d8cd69 David Teigland    2007-05-29  374      cl->cl_timewarn_cs = 
dlm_config.ci_timewarn_cs;
c6ff669b David Teigland    2011-03-28  375      cl->cl_waitwarn_us = 
dlm_config.ci_waitwarn_us;
3881ac04 David Teigland    2011-07-07  376      cl->cl_new_rsb_count = 
dlm_config.ci_new_rsb_count;
60f98d18 David Teigland    2011-11-02  377      cl->cl_recover_callbacks = 
dlm_config.ci_recover_callbacks;
60f98d18 David Teigland    2011-11-02  378      memcpy(cl->cl_cluster_name, 
dlm_config.ci_cluster_name,
60f98d18 David Teigland    2011-11-02  379             DLM_LOCKSPACE_LEN);
d200778e David Teigland    2007-01-09  380  
e7fd4179 David Teigland    2006-01-18  381      space_list = &sps->ss_group;
e7fd4179 David Teigland    2006-01-18  382      comm_list = &cms->cs_group;
f89ab861 Joel Becker       2008-07-17  383      return &cl->group;
e7fd4179 David Teigland    2006-01-18  384  
e7fd4179 David Teigland    2006-01-18  385   fail:
e7fd4179 David Teigland    2006-01-18  386      kfree(cl);
e7fd4179 David Teigland    2006-01-18  387      kfree(sps);
e7fd4179 David Teigland    2006-01-18  388      kfree(cms);
a6795e9e Joel Becker       2008-07-17  389      return ERR_PTR(-ENOMEM);
e7fd4179 David Teigland    2006-01-18  390  }
e7fd4179 David Teigland    2006-01-18  391  
e7fd4179 David Teigland    2006-01-18  392  static void drop_cluster(struct 
config_group *g, struct config_item *i)
e7fd4179 David Teigland    2006-01-18  393  {
27eccf46 Andrew Morton     2008-09-05  394      struct dlm_cluster *cl = 
config_item_to_cluster(i);
e7fd4179 David Teigland    2006-01-18  395  
1ae1602d Christoph Hellwig 2016-02-26  396      
configfs_remove_default_groups(&cl->group);
e7fd4179 David Teigland    2006-01-18  397  
e7fd4179 David Teigland    2006-01-18  398      space_list = NULL;
e7fd4179 David Teigland    2006-01-18  399      comm_list = NULL;
e7fd4179 David Teigland    2006-01-18  400  
e7fd4179 David Teigland    2006-01-18  401      config_item_put(i);
e7fd4179 David Teigland    2006-01-18  402  }
e7fd4179 David Teigland    2006-01-18  403  
e7fd4179 David Teigland    2006-01-18  404  static void release_cluster(struct 
config_item *i)
e7fd4179 David Teigland    2006-01-18  405  {
27eccf46 Andrew Morton     2008-09-05  406      struct dlm_cluster *cl = 
config_item_to_cluster(i);
e7fd4179 David Teigland    2006-01-18  407      kfree(cl);
e7fd4179 David Teigland    2006-01-18  408  }
e7fd4179 David Teigland    2006-01-18  409  
f89ab861 Joel Becker       2008-07-17  410  static struct config_group 
*make_space(struct config_group *g, const char *name)
e7fd4179 David Teigland    2006-01-18  411  {
51409340 David Teigland    2008-07-31  412      struct dlm_space *sp = NULL;
51409340 David Teigland    2008-07-31  413      struct dlm_nodes *nds = NULL;
e7fd4179 David Teigland    2006-01-18  414  
573c24c4 David Teigland    2009-11-30  415      sp = kzalloc(sizeof(struct 
dlm_space), GFP_NOFS);
573c24c4 David Teigland    2009-11-30  416      nds = kzalloc(sizeof(struct 
dlm_nodes), GFP_NOFS);
e7fd4179 David Teigland    2006-01-18  417  
1ae1602d Christoph Hellwig 2016-02-26  418      if (!sp || !nds)
e7fd4179 David Teigland    2006-01-18  419              goto fail;
e7fd4179 David Teigland    2006-01-18  420  
e7fd4179 David Teigland    2006-01-18  421      
config_group_init_type_name(&sp->group, name, &space_type);
e7fd4179 David Teigland    2006-01-18  422  
1ae1602d Christoph Hellwig 2016-02-26 @423      
config_group_init_type_name(&nds->ns_group, "nodes", &nodes_type);
1ae1602d Christoph Hellwig 2016-02-26  424      
configfs_add_default_group(&nds->ns_group, &sp->group);
e7fd4179 David Teigland    2006-01-18  425  
e7fd4179 David Teigland    2006-01-18  426      INIT_LIST_HEAD(&sp->members);
90135925 David Teigland    2006-01-20  427      mutex_init(&sp->members_lock);
e7fd4179 David Teigland    2006-01-18  428      sp->members_count = 0;
f89ab861 Joel Becker       2008-07-17  429      return &sp->group;
e7fd4179 David Teigland    2006-01-18  430  
e7fd4179 David Teigland    2006-01-18  431   fail:
e7fd4179 David Teigland    2006-01-18  432      kfree(sp);
e7fd4179 David Teigland    2006-01-18  433      kfree(nds);
a6795e9e Joel Becker       2008-07-17  434      return ERR_PTR(-ENOMEM);
e7fd4179 David Teigland    2006-01-18  435  }
e7fd4179 David Teigland    2006-01-18  436  
e7fd4179 David Teigland    2006-01-18  437  static void drop_space(struct 
config_group *g, struct config_item *i)
e7fd4179 David Teigland    2006-01-18  438  {
27eccf46 Andrew Morton     2008-09-05  439      struct dlm_space *sp = 
config_item_to_space(i);
e7fd4179 David Teigland    2006-01-18  440  
e7fd4179 David Teigland    2006-01-18  441      /* assert 
list_empty(&sp->members) */
e7fd4179 David Teigland    2006-01-18  442  
1ae1602d Christoph Hellwig 2016-02-26  443      
configfs_remove_default_groups(&sp->group);
e7fd4179 David Teigland    2006-01-18  444      config_item_put(i);
e7fd4179 David Teigland    2006-01-18  445  }
e7fd4179 David Teigland    2006-01-18  446  
e7fd4179 David Teigland    2006-01-18  447  static void release_space(struct 
config_item *i)
e7fd4179 David Teigland    2006-01-18  448  {
27eccf46 Andrew Morton     2008-09-05  449      struct dlm_space *sp = 
config_item_to_space(i);
e7fd4179 David Teigland    2006-01-18  450      kfree(sp);
e7fd4179 David Teigland    2006-01-18  451  }
e7fd4179 David Teigland    2006-01-18  452  
f89ab861 Joel Becker       2008-07-17  453  static struct config_item 
*make_comm(struct config_group *g, const char *name)
e7fd4179 David Teigland    2006-01-18  454  {
51409340 David Teigland    2008-07-31  455      struct dlm_comm *cm;
e7fd4179 David Teigland    2006-01-18  456  
573c24c4 David Teigland    2009-11-30  457      cm = kzalloc(sizeof(struct 
dlm_comm), GFP_NOFS);
e7fd4179 David Teigland    2006-01-18  458      if (!cm)
a6795e9e Joel Becker       2008-07-17  459              return ERR_PTR(-ENOMEM);
e7fd4179 David Teigland    2006-01-18  460  
e7fd4179 David Teigland    2006-01-18 @461      
config_item_init_type_name(&cm->item, name, &comm_type);
60f98d18 David Teigland    2011-11-02  462  
60f98d18 David Teigland    2011-11-02  463      cm->seq = dlm_comm_count++;
60f98d18 David Teigland    2011-11-02  464      if (!cm->seq)
60f98d18 David Teigland    2011-11-02  465              cm->seq = 
dlm_comm_count++;
60f98d18 David Teigland    2011-11-02  466  
e7fd4179 David Teigland    2006-01-18  467      cm->nodeid = -1;
e7fd4179 David Teigland    2006-01-18  468      cm->local = 0;
e7fd4179 David Teigland    2006-01-18  469      cm->addr_count = 0;
f89ab861 Joel Becker       2008-07-17  470      return &cm->item;
e7fd4179 David Teigland    2006-01-18  471  }
e7fd4179 David Teigland    2006-01-18  472  
e7fd4179 David Teigland    2006-01-18  473  static void drop_comm(struct 
config_group *g, struct config_item *i)
e7fd4179 David Teigland    2006-01-18  474  {
27eccf46 Andrew Morton     2008-09-05  475      struct dlm_comm *cm = 
config_item_to_comm(i);
e7fd4179 David Teigland    2006-01-18  476      if (local_comm == cm)
e7fd4179 David Teigland    2006-01-18  477              local_comm = NULL;
1c032c03 David Teigland    2006-04-28  478      dlm_lowcomms_close(cm->nodeid);
e7fd4179 David Teigland    2006-01-18  479      while (cm->addr_count--)
e7fd4179 David Teigland    2006-01-18  480              
kfree(cm->addr[cm->addr_count]);
e7fd4179 David Teigland    2006-01-18  481      config_item_put(i);
e7fd4179 David Teigland    2006-01-18  482  }
e7fd4179 David Teigland    2006-01-18  483  
e7fd4179 David Teigland    2006-01-18  484  static void release_comm(struct 
config_item *i)
e7fd4179 David Teigland    2006-01-18  485  {
27eccf46 Andrew Morton     2008-09-05  486      struct dlm_comm *cm = 
config_item_to_comm(i);
e7fd4179 David Teigland    2006-01-18  487      kfree(cm);
e7fd4179 David Teigland    2006-01-18  488  }
e7fd4179 David Teigland    2006-01-18  489  
f89ab861 Joel Becker       2008-07-17  490  static struct config_item 
*make_node(struct config_group *g, const char *name)
e7fd4179 David Teigland    2006-01-18  491  {
27eccf46 Andrew Morton     2008-09-05  492      struct dlm_space *sp = 
config_item_to_space(g->cg_item.ci_parent);
51409340 David Teigland    2008-07-31  493      struct dlm_node *nd;
e7fd4179 David Teigland    2006-01-18  494  
573c24c4 David Teigland    2009-11-30  495      nd = kzalloc(sizeof(struct 
dlm_node), GFP_NOFS);
e7fd4179 David Teigland    2006-01-18  496      if (!nd)
a6795e9e Joel Becker       2008-07-17  497              return ERR_PTR(-ENOMEM);
e7fd4179 David Teigland    2006-01-18  498  
e7fd4179 David Teigland    2006-01-18 @499      
config_item_init_type_name(&nd->item, name, &node_type);
e7fd4179 David Teigland    2006-01-18  500      nd->nodeid = -1;
e7fd4179 David Teigland    2006-01-18  501      nd->weight = 1;  /* default 
weight of 1 if none is set */
d44e0fc7 David Teigland    2008-03-18  502      nd->new = 1;     /* set to 0 
once it's been read by dlm_nodeid_list() */
e7fd4179 David Teigland    2006-01-18  503  
90135925 David Teigland    2006-01-20  504      mutex_lock(&sp->members_lock);
e7fd4179 David Teigland    2006-01-18  505      list_add(&nd->list, 
&sp->members);
e7fd4179 David Teigland    2006-01-18  506      sp->members_count++;
90135925 David Teigland    2006-01-20  507      mutex_unlock(&sp->members_lock);
e7fd4179 David Teigland    2006-01-18  508  
f89ab861 Joel Becker       2008-07-17  509      return &nd->item;
e7fd4179 David Teigland    2006-01-18  510  }
e7fd4179 David Teigland    2006-01-18  511  
e7fd4179 David Teigland    2006-01-18  512  static void drop_node(struct 
config_group *g, struct config_item *i)
e7fd4179 David Teigland    2006-01-18  513  {
27eccf46 Andrew Morton     2008-09-05  514      struct dlm_space *sp = 
config_item_to_space(g->cg_item.ci_parent);
27eccf46 Andrew Morton     2008-09-05  515      struct dlm_node *nd = 
config_item_to_node(i);
e7fd4179 David Teigland    2006-01-18  516  
90135925 David Teigland    2006-01-20  517      mutex_lock(&sp->members_lock);
e7fd4179 David Teigland    2006-01-18  518      list_del(&nd->list);
e7fd4179 David Teigland    2006-01-18  519      sp->members_count--;
90135925 David Teigland    2006-01-20  520      mutex_unlock(&sp->members_lock);
e7fd4179 David Teigland    2006-01-18  521  
e7fd4179 David Teigland    2006-01-18  522      config_item_put(i);
e7fd4179 David Teigland    2006-01-18  523  }
e7fd4179 David Teigland    2006-01-18  524  
e7fd4179 David Teigland    2006-01-18  525  static void release_node(struct 
config_item *i)
e7fd4179 David Teigland    2006-01-18  526  {
27eccf46 Andrew Morton     2008-09-05  527      struct dlm_node *nd = 
config_item_to_node(i);
e7fd4179 David Teigland    2006-01-18  528      kfree(nd);
e7fd4179 David Teigland    2006-01-18  529  }
e7fd4179 David Teigland    2006-01-18  530  
51409340 David Teigland    2008-07-31  531  static struct dlm_clusters 
clusters_root = {
e7fd4179 David Teigland    2006-01-18  532      .subsys = {
e7fd4179 David Teigland    2006-01-18  533              .su_group = {
e7fd4179 David Teigland    2006-01-18  534                      .cg_item = {
e7fd4179 David Teigland    2006-01-18  535                              
.ci_namebuf = "dlm",
e7fd4179 David Teigland    2006-01-18 @536                              
.ci_type = &clusters_type,
e7fd4179 David Teigland    2006-01-18  537                      },
e7fd4179 David Teigland    2006-01-18  538              },
e7fd4179 David Teigland    2006-01-18  539      },
e7fd4179 David Teigland    2006-01-18  540  };
e7fd4179 David Teigland    2006-01-18  541  

:::::: The code at line 358 was first introduced by commit
:::::: e7fd41792fc0ee52a05fcaac87511f118328d147 [DLM] The core of the DLM for 
GFS2/CLVM

:::::: TO: David Teigland <[email protected]>
:::::: CC: Steven Whitehouse <[email protected]>

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

Attachment: .config.gz
Description: application/gzip

Reply via email to