linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/pinctrl/bcm/pinctrl-ns.c:286:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers
@ 2021-12-22 22:55 kernel test robot
  2021-12-23  8:48 ` Rafał Miłecki
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-12-22 22:55 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: llvm, 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:   16 hours ago
config: riscv-randconfig-r042-20211222 (https://download.01.org/0day-ci/archive/20211223/202112230616.y4Aa2Lyi-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project de4e0195ae1c39f1c3b07834b8e32c113f4f20eb)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 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=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

>> drivers/pinctrl/bcm/pinctrl-ns.c:286:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                                               function->groups,
                                               ^~~~~~~~~~~~~~~~
   drivers/pinctrl/bcm/../pinmux.h:153:18: note: passing argument to parameter 'groups' here
                                   const char **groups,
                                                ^
   1 error generated.


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:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers
  2021-12-22 22:55 drivers/pinctrl/bcm/pinctrl-ns.c:286:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers kernel test robot
@ 2021-12-23  8:48 ` Rafał Miłecki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafał Miłecki @ 2021-12-23  8:48 UTC (permalink / raw)
  To: kernel test robot; +Cc: llvm, kbuild-all, linux-kernel

On 22.12.2021 23: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:   16 hours ago
> config: riscv-randconfig-r042-20211222 (https://download.01.org/0day-ci/archive/20211223/202112230616.y4Aa2Lyi-lkp@intel.com/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project de4e0195ae1c39f1c3b07834b8e32c113f4f20eb)
> 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
>          # install riscv cross compiling tool for clang build
>          # apt-get install binutils-riscv64-linux-gnu
>          # 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=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>>> drivers/pinctrl/bcm/pinctrl-ns.c:286:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>                                                 function->groups,
>                                                 ^~~~~~~~~~~~~~~~
>     drivers/pinctrl/bcm/../pinmux.h:153:18: note: passing argument to parameter 'groups' here
>                                     const char **groups,
>                                                  ^
>     1 error generated.

You are testing this patch against wrong tree. See message in my commit:

V3: Don't drop "const" from "ns_pinctrl_function" @groups. It's possible
     thanks to the commit bd0aae66c482 ("pinctrl: add one more "const" for
     generic function groups").
     This patch depends on above commit for that reason.

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 22:55 drivers/pinctrl/bcm/pinctrl-ns.c:286:10: error: passing 'const char *const *const' to parameter of type 'const char **' discards qualifiers kernel test robot
2021-12-23  8:48 ` 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;
as well as URLs for NNTP newsgroup(s).