[PATCH v2] remoteproc: remove unnecessary (void*) conversions

kernel test robot lkp at intel.com
Sun Mar 26 04:14:42 PDT 2023


Hi Yu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v6.3-rc3]
[also build test WARNING on linus/master]
[cannot apply to remoteproc/rproc-next next-20230324]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yu-Zhe/remoteproc-remove-unnecessary-void-conversions/20230320-141403
patch link:    https://lore.kernel.org/r/20230320061157.29660-1-yuzhe%40nfschina.com
patch subject: [PATCH v2] remoteproc: remove unnecessary (void*) conversions
config: arm-randconfig-s053-20230326 (https://download.01.org/0day-ci/archive/20230326/202303261950.I6rq9snr-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/38335303eda6c4de037cd00e20c9065a76f82291
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Yu-Zhe/remoteproc-remove-unnecessary-void-conversions/20230320-141403
        git checkout 38335303eda6c4de037cd00e20c9065a76f82291
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/remoteproc/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp at intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303261950.I6rq9snr-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/remoteproc/stm32_rproc.c:122:12: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *va @@     got void [noderef] __iomem * @@
   drivers/remoteproc/stm32_rproc.c:122:12: sparse:     expected void *va
   drivers/remoteproc/stm32_rproc.c:122:12: sparse:     got void [noderef] __iomem *
   drivers/remoteproc/stm32_rproc.c:139:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *io_addr @@     got void *va @@
   drivers/remoteproc/stm32_rproc.c:139:20: sparse:     expected void volatile [noderef] __iomem *io_addr
   drivers/remoteproc/stm32_rproc.c:139:20: sparse:     got void *va
>> drivers/remoteproc/stm32_rproc.c:632:21: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct resource_table * @@     got void [noderef] __iomem *rsc_va @@
   drivers/remoteproc/stm32_rproc.c:632:21: sparse:     expected struct resource_table *
   drivers/remoteproc/stm32_rproc.c:632:21: sparse:     got void [noderef] __iomem *rsc_va

vim +632 drivers/remoteproc/stm32_rproc.c

   588	
   589	static struct resource_table *
   590	stm32_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
   591	{
   592		struct stm32_rproc *ddata = rproc->priv;
   593		struct device *dev = rproc->dev.parent;
   594		phys_addr_t rsc_pa;
   595		u32 rsc_da;
   596		int err;
   597	
   598		/* The resource table has already been mapped, nothing to do */
   599		if (ddata->rsc_va)
   600			goto done;
   601	
   602		err = regmap_read(ddata->rsctbl.map, ddata->rsctbl.reg, &rsc_da);
   603		if (err) {
   604			dev_err(dev, "failed to read rsc tbl addr\n");
   605			return ERR_PTR(-EINVAL);
   606		}
   607	
   608		if (!rsc_da)
   609			/* no rsc table */
   610			return ERR_PTR(-ENOENT);
   611	
   612		err = stm32_rproc_da_to_pa(rproc, rsc_da, &rsc_pa);
   613		if (err)
   614			return ERR_PTR(err);
   615	
   616		ddata->rsc_va = devm_ioremap_wc(dev, rsc_pa, RSC_TBL_SIZE);
   617		if (IS_ERR_OR_NULL(ddata->rsc_va)) {
   618			dev_err(dev, "Unable to map memory region: %pa+%zx\n",
   619				&rsc_pa, RSC_TBL_SIZE);
   620			ddata->rsc_va = NULL;
   621			return ERR_PTR(-ENOMEM);
   622		}
   623	
   624	done:
   625		/*
   626		 * Assuming the resource table fits in 1kB is fair.
   627		 * Notice for the detach, that this 1 kB memory area has to be reserved in the coprocessor
   628		 * firmware for the resource table. On detach, the remoteproc core re-initializes this
   629		 * entire area by overwriting it with the initial values stored in rproc->clean_table.
   630		 */
   631		*table_sz = RSC_TBL_SIZE;
 > 632		return ddata->rsc_va;
   633	}
   634	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests



More information about the linux-arm-kernel mailing list