The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type
@ 2021-12-22  8:55 kernel test robot
  2021-12-22  9:09 ` Rafał Miłecki
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-12-22  8:55 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: kbuild-all, linux-kernel, 0day robot

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20211222-144502/Rafa-Mi-ecki/pinctrl-bcm-ns-use-generic-groups-functions-helpers/20211117-064419
head:   da7c70cdea1466b4234a30658ee2b5383545a629
commit: da7c70cdea1466b4234a30658ee2b5383545a629 pinctrl: bcm: ns: use generic groups & functions helpers
date:   2 hours ago
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211222/202112221651.gLNfcGwH-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/da7c70cdea1466b4234a30658ee2b5383545a629
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20211222-144502/Rafa-Mi-ecki/pinctrl-bcm-ns-use-generic-groups-functions-helpers/20211117-064419
        git checkout da7c70cdea1466b4234a30658ee2b5383545a629
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/pinctrl/bcm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/pinctrl/bcm/pinctrl-ns.c: In function 'ns_pinctrl_probe':
>> drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     286 |                                             function->groups,
         |                                             ~~~~~~~~^~~~~~~~
   In file included from drivers/pinctrl/bcm/pinctrl-ns.c:18:
   drivers/pinctrl/bcm/../pinmux.h:153:46: note: expected 'const char **' but argument is of type 'const char * const*'
     153 |                                 const char **groups,
         |                                 ~~~~~~~~~~~~~^~~~~~


vim +286 drivers/pinctrl/bcm/pinctrl-ns.c

   207	
   208	static int ns_pinctrl_probe(struct platform_device *pdev)
   209	{
   210		struct device *dev = &pdev->dev;
   211		const struct of_device_id *of_id;
   212		struct ns_pinctrl *ns_pinctrl;
   213		struct pinctrl_desc *pctldesc;
   214		struct pinctrl_pin_desc *pin;
   215		struct resource *res;
   216		int i;
   217	
   218		ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL);
   219		if (!ns_pinctrl)
   220			return -ENOMEM;
   221		pctldesc = &ns_pinctrl->pctldesc;
   222		platform_set_drvdata(pdev, ns_pinctrl);
   223	
   224		/* Set basic properties */
   225	
   226		ns_pinctrl->dev = dev;
   227	
   228		of_id = of_match_device(ns_pinctrl_of_match_table, dev);
   229		if (!of_id)
   230			return -EINVAL;
   231		ns_pinctrl->chipset_flag = (uintptr_t)of_id->data;
   232	
   233		res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
   234						   "cru_gpio_control");
   235		ns_pinctrl->base = devm_ioremap_resource(dev, res);
   236		if (IS_ERR(ns_pinctrl->base)) {
   237			dev_err(dev, "Failed to map pinctrl regs\n");
   238			return PTR_ERR(ns_pinctrl->base);
   239		}
   240	
   241		memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc));
   242	
   243		/* Set pinctrl properties */
   244	
   245		pctldesc->pins = devm_kcalloc(dev, ARRAY_SIZE(ns_pinctrl_pins),
   246					      sizeof(struct pinctrl_pin_desc),
   247					      GFP_KERNEL);
   248		if (!pctldesc->pins)
   249			return -ENOMEM;
   250		for (i = 0, pin = (struct pinctrl_pin_desc *)&pctldesc->pins[0];
   251		     i < ARRAY_SIZE(ns_pinctrl_pins); i++) {
   252			const struct pinctrl_pin_desc *src = &ns_pinctrl_pins[i];
   253			unsigned int chipsets = (uintptr_t)src->drv_data;
   254	
   255			if (chipsets & ns_pinctrl->chipset_flag) {
   256				memcpy(pin++, src, sizeof(*src));
   257				pctldesc->npins++;
   258			}
   259		}
   260	
   261		/* Register */
   262	
   263		ns_pinctrl->pctldev = devm_pinctrl_register(dev, pctldesc, ns_pinctrl);
   264		if (IS_ERR(ns_pinctrl->pctldev)) {
   265			dev_err(dev, "Failed to register pinctrl\n");
   266			return PTR_ERR(ns_pinctrl->pctldev);
   267		}
   268	
   269		for (i = 0; i < ARRAY_SIZE(ns_pinctrl_groups); i++) {
   270			const struct ns_pinctrl_group *group = &ns_pinctrl_groups[i];
   271	
   272			if (!(group->chipsets & ns_pinctrl->chipset_flag))
   273				continue;
   274	
   275			pinctrl_generic_add_group(ns_pinctrl->pctldev, group->name,
   276						  group->pins, group->num_pins, NULL);
   277		}
   278	
   279		for (i = 0; i < ARRAY_SIZE(ns_pinctrl_functions); i++) {
   280			const struct ns_pinctrl_function *function = &ns_pinctrl_functions[i];
   281	
   282			if (!(function->chipsets & ns_pinctrl->chipset_flag))
   283				continue;
   284	
   285			pinmux_generic_add_function(ns_pinctrl->pctldev, function->name,
 > 286						    function->groups,
   287						    function->num_groups, NULL);
   288		}
   289	
   290		return 0;
   291	}
   292	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

* Re: drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type
  2021-12-22  8:55 drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type kernel test robot
@ 2021-12-22  9:09 ` Rafał Miłecki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafał Miłecki @ 2021-12-22  9:09 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel

On 22.12.2021 09:55, kernel test robot wrote:
> tree:   https://github.com/0day-ci/linux/commits/UPDATE-20211222-144502/Rafa-Mi-ecki/pinctrl-bcm-ns-use-generic-groups-functions-helpers/20211117-064419
> head:   da7c70cdea1466b4234a30658ee2b5383545a629
> commit: da7c70cdea1466b4234a30658ee2b5383545a629 pinctrl: bcm: ns: use generic groups & functions helpers
> date:   2 hours ago
> config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211222/202112221651.gLNfcGwH-lkp@intel.com/config)
> compiler: arceb-elf-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # https://github.com/0day-ci/linux/commit/da7c70cdea1466b4234a30658ee2b5383545a629
>          git remote add linux-review https://github.com/0day-ci/linux
>          git fetch --no-tags linux-review UPDATE-20211222-144502/Rafa-Mi-ecki/pinctrl-bcm-ns-use-generic-groups-functions-helpers/20211117-064419
>          git checkout da7c70cdea1466b4234a30658ee2b5383545a629
>          # save the config file to linux build tree
>          mkdir build_dir
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/pinctrl/bcm/
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>     drivers/pinctrl/bcm/pinctrl-ns.c: In function 'ns_pinctrl_probe':
>>> drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>       286 |                                             function->groups,
>           |                                             ~~~~~~~~^~~~~~~~
>     In file included from drivers/pinctrl/bcm/pinctrl-ns.c:18:
>     drivers/pinctrl/bcm/../pinmux.h:153:46: note: expected 'const char **' but argument is of type 'const char * const*'
>       153 |                                 const char **groups,
>           |                                 ~~~~~~~~~~~~~^~~~~~

This patch targets following git tree:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git/log/?h=for-next

As stated in the commit message it depends on the:
bd0aae66c482 ("pinctrl: add one more "const" for function groups")

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

end of thread, other threads:[~2021-12-22  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-22  8:55 drivers/pinctrl/bcm/pinctrl-ns.c:286:53: warning: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type kernel test robot
2021-12-22  9:09 ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox