Re: [PATCH] PCI: endpoint: make config_item_type const

2017-10-15 Thread kbuild test robot
Hi Bhumika,

[auto build test WARNING on pci/next]
[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/PCI-endpoint-make-config_item_type-const/20171015-175843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-s1-201742+CONFIG_DEBUG_INFO_REDUCED (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 >>):

   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_add_epc_group':
>> drivers/pci/endpoint/pci-ep-cfs.c:174:43: warning: passing argument 3 of 
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
>> type [-Wdiscarded-qualifiers]
 config_group_init_type_name(group, name, _epc_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   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,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_epf_make':
   drivers/pci/endpoint/pci-ep-cfs.c:380: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(_group->group, name, _epf_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   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,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_add_epf_group':
>> drivers/pci/endpoint/pci-ep-cfs.c:413:7: warning: passing argument 3 of 
>> 'configfs_register_default_group' discards 'const' qualifier from pointer 
>> target type [-Wdiscarded-qualifiers]
  _epf_group_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: At top level:
>> drivers/pci/endpoint/pci-ep-cfs.c:447:15: warning: initialization discards 
>> 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   .ci_type = _ep_type,
  ^
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_init':
   drivers/pci/endpoint/pci-ep-cfs.c:468:10: warning: passing argument 3 of 
'configfs_register_default_group' discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 _functions_type);
 ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c:478:7: warning: passing argument 3 of 
'configfs_register_default_group' discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
  _controllers_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~

vim +174 drivers/pci/endpoint/pci-ep-cfs.c

d7467991 Kishon Vijay Abraham I 2017-03-27  158  
d7467991 Kishon Vijay Abraham I 2017-03-27  159  struct config_group 
*pci_ep_cfs_add_epc_group(const char *name)
d7467991 Kishon Vijay Abraham I 2017-03-27  160  {
d7467991 Kishon Vijay Abraham I 2017-03-27  161 int ret;
d7467991 Kishon Vijay Abraham I 2017-03-27  162 struct pci_epc *epc;
d7467991 Kishon Vijay Abraham I 2017-03-27  163 struct config_group 
*group;
d7467991 Kishon Vijay Abraham I 2017-03-27  164 struct pci_epc_group 
*epc_group;
d7467991 Kishon Vijay Abraham I 2017-03-27  165  
d7467991 

Re: [PATCH] PCI: endpoint: make config_item_type const

2017-10-15 Thread kbuild test robot
Hi Bhumika,

[auto build test WARNING on pci/next]
[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/PCI-endpoint-make-config_item_type-const/20171015-175843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: i386-randconfig-s1-201742+CONFIG_DEBUG_INFO_REDUCED (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 >>):

   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_add_epc_group':
>> drivers/pci/endpoint/pci-ep-cfs.c:174:43: warning: passing argument 3 of 
>> 'config_group_init_type_name' discards 'const' qualifier from pointer target 
>> type [-Wdiscarded-qualifiers]
 config_group_init_type_name(group, name, _epc_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   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,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_epf_make':
   drivers/pci/endpoint/pci-ep-cfs.c:380: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(_group->group, name, _epf_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   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,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_add_epf_group':
>> drivers/pci/endpoint/pci-ep-cfs.c:413:7: warning: passing argument 3 of 
>> 'configfs_register_default_group' discards 'const' qualifier from pointer 
>> target type [-Wdiscarded-qualifiers]
  _epf_group_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c: At top level:
>> drivers/pci/endpoint/pci-ep-cfs.c:447:15: warning: initialization discards 
>> 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   .ci_type = _ep_type,
  ^
   drivers/pci/endpoint/pci-ep-cfs.c: In function 'pci_ep_cfs_init':
   drivers/pci/endpoint/pci-ep-cfs.c:468:10: warning: passing argument 3 of 
'configfs_register_default_group' discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
 _functions_type);
 ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~
   drivers/pci/endpoint/pci-ep-cfs.c:478:7: warning: passing argument 3 of 
'configfs_register_default_group' discards 'const' qualifier from pointer 
target type [-Wdiscarded-qualifiers]
  _controllers_type);
  ^
   In file included from include/linux/pci-ep-cfs.h:15:0,
from drivers/pci/endpoint/pci-ep-cfs.c:25:
   include/linux/configfs.h:262:1: note: expected 'struct config_item_type *' 
but argument is of type 'const struct config_item_type *'
configfs_register_default_group(struct config_group *parent_group,
^~~

vim +174 drivers/pci/endpoint/pci-ep-cfs.c

d7467991 Kishon Vijay Abraham I 2017-03-27  158  
d7467991 Kishon Vijay Abraham I 2017-03-27  159  struct config_group 
*pci_ep_cfs_add_epc_group(const char *name)
d7467991 Kishon Vijay Abraham I 2017-03-27  160  {
d7467991 Kishon Vijay Abraham I 2017-03-27  161 int ret;
d7467991 Kishon Vijay Abraham I 2017-03-27  162 struct pci_epc *epc;
d7467991 Kishon Vijay Abraham I 2017-03-27  163 struct config_group 
*group;
d7467991 Kishon Vijay Abraham I 2017-03-27  164 struct pci_epc_group 
*epc_group;
d7467991 Kishon Vijay Abraham I 2017-03-27  165  
d7467991 

Re: [PATCH] PCI: endpoint: make config_item_type const

2017-10-12 Thread Bhumika Goyal
On Thu, Oct 12, 2017 at 2:50 PM, Bhumika Goyal  wrote:
> This is a followup patch for:
> https://patchwork.kernel.org/patch/649/ and
> https://lkml.org/lkml/2017/10/11/375
>
> Make config_item_type structures const as they are either passed to a
> function having the argument as const or stored in the const "ci_type"
> field of a config_item structure.
>
> Done using Coccinelle.
>

Actually, this patch is dependent on the patches in the links
https://lkml.org/lkml/2017/10/11/375 and
https://patchwork.kernel.org/patch/649/. Therefore, this patch
won't be correct unless the patches in these links gets applied.

> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/pci/endpoint/pci-ep-cfs.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/endpoint/pci-ep-cfs.c 
> b/drivers/pci/endpoint/pci-ep-cfs.c
> index 424fdd6..4f74386 100644
> --- a/drivers/pci/endpoint/pci-ep-cfs.c
> +++ b/drivers/pci/endpoint/pci-ep-cfs.c
> @@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item 
> *epc_item,
> .drop_link  = pci_epc_epf_unlink,
>  };
>
> -static struct config_item_type pci_epc_type = {
> +static const struct config_item_type pci_epc_type = {
> .ct_item_ops= _epc_item_ops,
> .ct_attrs   = pci_epc_attrs,
> .ct_owner   = THIS_MODULE,
> @@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item)
> .release= pci_epf_release,
>  };
>
> -static struct config_item_type pci_epf_type = {
> +static const struct config_item_type pci_epf_type = {
> .ct_item_ops= _epf_ops,
> .ct_attrs   = pci_epf_attrs,
> .ct_owner   = THIS_MODULE,
> @@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, 
> struct config_item *item)
> .drop_item  = _epf_drop,
>  };
>
> -static struct config_item_type pci_epf_group_type = {
> +static const struct config_item_type pci_epf_group_type = {
> .ct_group_ops   = _epf_group_ops,
> .ct_owner   = THIS_MODULE,
>  };
> @@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group 
> *group)
>  }
>  EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group);
>
> -static struct config_item_type pci_functions_type = {
> +static const struct config_item_type pci_functions_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> -static struct config_item_type pci_controllers_type = {
> +static const struct config_item_type pci_controllers_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> -static struct config_item_type pci_ep_type = {
> +static const struct config_item_type pci_ep_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> --
> 1.9.1
>


Re: [PATCH] PCI: endpoint: make config_item_type const

2017-10-12 Thread Bhumika Goyal
On Thu, Oct 12, 2017 at 2:50 PM, Bhumika Goyal  wrote:
> This is a followup patch for:
> https://patchwork.kernel.org/patch/649/ and
> https://lkml.org/lkml/2017/10/11/375
>
> Make config_item_type structures const as they are either passed to a
> function having the argument as const or stored in the const "ci_type"
> field of a config_item structure.
>
> Done using Coccinelle.
>

Actually, this patch is dependent on the patches in the links
https://lkml.org/lkml/2017/10/11/375 and
https://patchwork.kernel.org/patch/649/. Therefore, this patch
won't be correct unless the patches in these links gets applied.

> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/pci/endpoint/pci-ep-cfs.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/endpoint/pci-ep-cfs.c 
> b/drivers/pci/endpoint/pci-ep-cfs.c
> index 424fdd6..4f74386 100644
> --- a/drivers/pci/endpoint/pci-ep-cfs.c
> +++ b/drivers/pci/endpoint/pci-ep-cfs.c
> @@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item 
> *epc_item,
> .drop_link  = pci_epc_epf_unlink,
>  };
>
> -static struct config_item_type pci_epc_type = {
> +static const struct config_item_type pci_epc_type = {
> .ct_item_ops= _epc_item_ops,
> .ct_attrs   = pci_epc_attrs,
> .ct_owner   = THIS_MODULE,
> @@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item)
> .release= pci_epf_release,
>  };
>
> -static struct config_item_type pci_epf_type = {
> +static const struct config_item_type pci_epf_type = {
> .ct_item_ops= _epf_ops,
> .ct_attrs   = pci_epf_attrs,
> .ct_owner   = THIS_MODULE,
> @@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, 
> struct config_item *item)
> .drop_item  = _epf_drop,
>  };
>
> -static struct config_item_type pci_epf_group_type = {
> +static const struct config_item_type pci_epf_group_type = {
> .ct_group_ops   = _epf_group_ops,
> .ct_owner   = THIS_MODULE,
>  };
> @@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group 
> *group)
>  }
>  EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group);
>
> -static struct config_item_type pci_functions_type = {
> +static const struct config_item_type pci_functions_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> -static struct config_item_type pci_controllers_type = {
> +static const struct config_item_type pci_controllers_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> -static struct config_item_type pci_ep_type = {
> +static const struct config_item_type pci_ep_type = {
> .ct_owner   = THIS_MODULE,
>  };
>
> --
> 1.9.1
>


[PATCH] PCI: endpoint: make config_item_type const

2017-10-12 Thread Bhumika Goyal
This is a followup patch for:
https://patchwork.kernel.org/patch/649/ and
https://lkml.org/lkml/2017/10/11/375

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

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/pci/endpoint/pci-ep-cfs.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/endpoint/pci-ep-cfs.c 
b/drivers/pci/endpoint/pci-ep-cfs.c
index 424fdd6..4f74386 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item,
.drop_link  = pci_epc_epf_unlink,
 };
 
-static struct config_item_type pci_epc_type = {
+static const struct config_item_type pci_epc_type = {
.ct_item_ops= _epc_item_ops,
.ct_attrs   = pci_epc_attrs,
.ct_owner   = THIS_MODULE,
@@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item)
.release= pci_epf_release,
 };
 
-static struct config_item_type pci_epf_type = {
+static const struct config_item_type pci_epf_type = {
.ct_item_ops= _epf_ops,
.ct_attrs   = pci_epf_attrs,
.ct_owner   = THIS_MODULE,
@@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, struct 
config_item *item)
.drop_item  = _epf_drop,
 };
 
-static struct config_item_type pci_epf_group_type = {
+static const struct config_item_type pci_epf_group_type = {
.ct_group_ops   = _epf_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group 
*group)
 }
 EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group);
 
-static struct config_item_type pci_functions_type = {
+static const struct config_item_type pci_functions_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_controllers_type = {
+static const struct config_item_type pci_controllers_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_ep_type = {
+static const struct config_item_type pci_ep_type = {
.ct_owner   = THIS_MODULE,
 };
 
-- 
1.9.1



[PATCH] PCI: endpoint: make config_item_type const

2017-10-12 Thread Bhumika Goyal
This is a followup patch for:
https://patchwork.kernel.org/patch/649/ and
https://lkml.org/lkml/2017/10/11/375

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

Done using Coccinelle.

Signed-off-by: Bhumika Goyal 
---
 drivers/pci/endpoint/pci-ep-cfs.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/endpoint/pci-ep-cfs.c 
b/drivers/pci/endpoint/pci-ep-cfs.c
index 424fdd6..4f74386 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -150,7 +150,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item,
.drop_link  = pci_epc_epf_unlink,
 };
 
-static struct config_item_type pci_epc_type = {
+static const struct config_item_type pci_epc_type = {
.ct_item_ops= _epc_item_ops,
.ct_attrs   = pci_epc_attrs,
.ct_owner   = THIS_MODULE,
@@ -361,7 +361,7 @@ static void pci_epf_release(struct config_item *item)
.release= pci_epf_release,
 };
 
-static struct config_item_type pci_epf_type = {
+static const struct config_item_type pci_epf_type = {
.ct_item_ops= _epf_ops,
.ct_attrs   = pci_epf_attrs,
.ct_owner   = THIS_MODULE,
@@ -400,7 +400,7 @@ static void pci_epf_drop(struct config_group *group, struct 
config_item *item)
.drop_item  = _epf_drop,
 };
 
-static struct config_item_type pci_epf_group_type = {
+static const struct config_item_type pci_epf_group_type = {
.ct_group_ops   = _epf_group_ops,
.ct_owner   = THIS_MODULE,
 };
@@ -428,15 +428,15 @@ void pci_ep_cfs_remove_epf_group(struct config_group 
*group)
 }
 EXPORT_SYMBOL(pci_ep_cfs_remove_epf_group);
 
-static struct config_item_type pci_functions_type = {
+static const struct config_item_type pci_functions_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_controllers_type = {
+static const struct config_item_type pci_controllers_type = {
.ct_owner   = THIS_MODULE,
 };
 
-static struct config_item_type pci_ep_type = {
+static const struct config_item_type pci_ep_type = {
.ct_owner   = THIS_MODULE,
 };
 
-- 
1.9.1