Re: [PATCH] pinctrl: add one more "const" for generic function groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi "Rafał,

I love your patch! Yet something to improve:

[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on v5.16-rc5 next-20211214]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/pinctrl-add-one-more-const-for-generic-function-groups/20211216-014859
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
config: arm64-randconfig-r031-20211215 (https://download.01.org/0day-ci/archive/20211216/202112160816.btxt2IyR-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dd245bab9fbb364faa1581e4f92ba3119a872fba)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/e4338a6ad34998afb60c5ad294aafa06cd7110a7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Rafa-Mi-ecki/pinctrl-add-one-more-const-for-generic-function-groups/20211216-014859
        git checkout e4338a6ad34998afb60c5ad294aafa06cd7110a7
        # 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=arm64 SHELL=/bin/bash drivers/pinctrl/

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

All errors (new ones prefixed by >>):

>> drivers/pinctrl/pinctrl-keembay.c:1594:8: error: assigning to 'const char **' from 'const char *const *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                           grp = func->group_names;
                               ^ ~~~~~~~~~~~~~~~~~
   1 error generated.
--
>> drivers/pinctrl/freescale/pinctrl-imx.c:672:24: error: read-only variable is not assignable
                   func->group_names[i] = child->name;
                   ~~~~~~~~~~~~~~~~~~~~ ^
   1 error generated.


vim +1594 drivers/pinctrl/pinctrl-keembay.c

ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1556  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1557  static int keembay_add_functions(struct keembay_pinctrl *kpc,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1558  				 struct function_desc *function)
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1559  {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1560  	unsigned int i;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1561  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1562  	/* Assign the groups for each function */
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1563  	for (i = 0; i < kpc->npins; i++) {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1564  		const struct pinctrl_pin_desc *pdesc = keembay_pins + i;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1565  		struct keembay_mux_desc *mux = pdesc->drv_data;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1566  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1567  		while (mux->name) {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1568  			struct function_desc *func;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1569  			const char **grp;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1570  			size_t grp_size;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1571  			u32 j, grp_num;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1572  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1573  			for (j = 0; j < kpc->nfuncs; j++) {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1574  				if (!strcmp(mux->name, function[j].name))
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1575  					break;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1576  			}
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1577  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1578  			if (j == kpc->nfuncs)
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1579  				return -EINVAL;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1580  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1581  			func = function + j;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1582  			grp_num = func->num_group_names;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1583  			grp_size = sizeof(*func->group_names);
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1584  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1585  			if (!func->group_names) {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1586  				func->group_names = devm_kcalloc(kpc->dev,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1587  								 grp_num,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1588  								 grp_size,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1589  								 GFP_KERNEL);
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1590  				if (!func->group_names)
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1591  					return -ENOMEM;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1592  			}
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1593  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06 @1594  			grp = func->group_names;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1595  			while (*grp)
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1596  				grp++;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1597  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1598  			*grp = pdesc->name;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1599  			mux++;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1600  		}
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1601  	}
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1602  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1603  	/* Add all functions */
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1604  	for (i = 0; i < kpc->nfuncs; i++) {
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1605  		pinmux_generic_add_function(kpc->pctrl,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1606  					    function[i].name,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1607  					    function[i].group_names,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1608  					    function[i].num_group_names,
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1609  					    function[i].data);
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1610  	}
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1611  
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1612  	return 0;
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1613  }
ffd4e739358be0 Lakshmi Sowjanya D 2021-08-06  1614  

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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux