lkml.org 
[lkml]   [2017]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: gadget: configfs: make config_item_type const
Hi Bhumika,

[auto build test WARNING on balbi-usb/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/usb-gadget-configfs-make-config_item_type-const/20171014-133441
base: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: i386-randconfig-x014-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 >>):

drivers/usb/gadget/configfs.c: In function 'config_desc_make':
>> drivers/usb/gadget/configfs.c:668:5: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
&gadget_config_type);
^
In file included from drivers/usb/gadget/configfs.c:1: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,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/configfs.c: In function 'gadgets_make':
drivers/usb/gadget/configfs.c:1421: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(&gi->group, name, &gadget_root_type);
^
In file included from drivers/usb/gadget/configfs.c:1: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,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/configfs.c:1424:4: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
&functions_type);
^
In file included from drivers/usb/gadget/configfs.c:1: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,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/configfs.c:1428:4: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
&config_desc_type);
^
In file included from drivers/usb/gadget/configfs.c:1: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,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/gadget/configfs.c: At top level:
>> drivers/usb/gadget/configfs.c:1487:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
.ci_type = &gadgets_type,
^

vim +668 drivers/usb/gadget/configfs.c

88af8bbe Sebastian Andrzej Siewior 2012-12-23 620
88af8bbe Sebastian Andrzej Siewior 2012-12-23 621 static struct config_group *config_desc_make(
88af8bbe Sebastian Andrzej Siewior 2012-12-23 622 struct config_group *group,
88af8bbe Sebastian Andrzej Siewior 2012-12-23 623 const char *name)
88af8bbe Sebastian Andrzej Siewior 2012-12-23 624 {
88af8bbe Sebastian Andrzej Siewior 2012-12-23 625 struct gadget_info *gi;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 626 struct config_usb_cfg *cfg;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 627 char buf[MAX_NAME_LEN];
88af8bbe Sebastian Andrzej Siewior 2012-12-23 628 char *num_str;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 629 u8 num;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 630 int ret;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 631
88af8bbe Sebastian Andrzej Siewior 2012-12-23 632 gi = container_of(group, struct gadget_info, configs_group);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 633 ret = snprintf(buf, MAX_NAME_LEN, "%s", name);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 634 if (ret >= MAX_NAME_LEN)
88af8bbe Sebastian Andrzej Siewior 2012-12-23 635 return ERR_PTR(-ENAMETOOLONG);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 636
88af8bbe Sebastian Andrzej Siewior 2012-12-23 637 num_str = strchr(buf, '.');
88af8bbe Sebastian Andrzej Siewior 2012-12-23 638 if (!num_str) {
88af8bbe Sebastian Andrzej Siewior 2012-12-23 639 pr_err("Unable to locate . in name.bConfigurationValue\n");
88af8bbe Sebastian Andrzej Siewior 2012-12-23 640 return ERR_PTR(-EINVAL);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 641 }
88af8bbe Sebastian Andrzej Siewior 2012-12-23 642
88af8bbe Sebastian Andrzej Siewior 2012-12-23 643 *num_str = '\0';
88af8bbe Sebastian Andrzej Siewior 2012-12-23 644 num_str++;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 645
88af8bbe Sebastian Andrzej Siewior 2012-12-23 646 if (!strlen(buf))
88af8bbe Sebastian Andrzej Siewior 2012-12-23 647 return ERR_PTR(-EINVAL);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 648
88af8bbe Sebastian Andrzej Siewior 2012-12-23 649 ret = kstrtou8(num_str, 0, &num);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 650 if (ret)
88af8bbe Sebastian Andrzej Siewior 2012-12-23 651 return ERR_PTR(ret);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 652
88af8bbe Sebastian Andrzej Siewior 2012-12-23 653 cfg = kzalloc(sizeof(*cfg), GFP_KERNEL);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 654 if (!cfg)
88af8bbe Sebastian Andrzej Siewior 2012-12-23 655 return ERR_PTR(-ENOMEM);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 656 cfg->c.label = kstrdup(buf, GFP_KERNEL);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 657 if (!cfg->c.label) {
88af8bbe Sebastian Andrzej Siewior 2012-12-23 658 ret = -ENOMEM;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 659 goto err;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 660 }
88af8bbe Sebastian Andrzej Siewior 2012-12-23 661 cfg->c.bConfigurationValue = num;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 662 cfg->c.MaxPower = CONFIG_USB_GADGET_VBUS_DRAW;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 663 cfg->c.bmAttributes = USB_CONFIG_ATT_ONE;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 664 INIT_LIST_HEAD(&cfg->string_list);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 665 INIT_LIST_HEAD(&cfg->func_list);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 666
88af8bbe Sebastian Andrzej Siewior 2012-12-23 667 config_group_init_type_name(&cfg->group, name,
88af8bbe Sebastian Andrzej Siewior 2012-12-23 @668 &gadget_config_type);
1ae1602d Christoph Hellwig 2016-02-26 669
88af8bbe Sebastian Andrzej Siewior 2012-12-23 670 config_group_init_type_name(&cfg->strings_group, "strings",
88af8bbe Sebastian Andrzej Siewior 2012-12-23 671 &gadget_config_name_strings_type);
1ae1602d Christoph Hellwig 2016-02-26 672 configfs_add_default_group(&cfg->strings_group, &cfg->group);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 673
88af8bbe Sebastian Andrzej Siewior 2012-12-23 674 ret = usb_add_config_only(&gi->cdev, &cfg->c);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 675 if (ret)
88af8bbe Sebastian Andrzej Siewior 2012-12-23 676 goto err;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 677
88af8bbe Sebastian Andrzej Siewior 2012-12-23 678 return &cfg->group;
88af8bbe Sebastian Andrzej Siewior 2012-12-23 679 err:
88af8bbe Sebastian Andrzej Siewior 2012-12-23 680 kfree(cfg->c.label);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 681 kfree(cfg);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 682 return ERR_PTR(ret);
88af8bbe Sebastian Andrzej Siewior 2012-12-23 683 }
88af8bbe Sebastian Andrzej Siewior 2012-12-23 684

:::::: The code at line 668 was first introduced by commit
:::::: 88af8bbe4ef781031ad3370847553f3b42ba0076 usb: gadget: the start of the configfs interface

:::::: TO: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
:::::: CC: Felipe Balbi <balbi@ti.com>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2017-10-14 08:08    [W:0.068 / U:43.796 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site