[linux-next:master 7642/8462] drivers/soc/tegra/fuse/fuse-tegra.c:188:20: sparse: sparse: incorrect type in assignment (different address spaces)

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c122052c3cb861b3e61a01d2c2ab9069e470663e
commit: 88724b78a84c85350c21ac8d4432f2cf5a77a10a [7642/8462] soc/tegra: fuse: Use resource-managed helpers
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20211218/202112181724.3i1cWCNa-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=88724b78a84c85350c21ac8d4432f2cf5a77a10a
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 88724b78a84c85350c21ac8d4432f2cf5a77a10a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/soc/tegra/fuse/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/soc/tegra/fuse/fuse-tegra.c:188:20: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *base @@     got void *base @@
   drivers/soc/tegra/fuse/fuse-tegra.c:188:20: sparse:     expected void [noderef] __iomem *base
   drivers/soc/tegra/fuse/fuse-tegra.c:188:20: sparse:     got void *base
>> drivers/soc/tegra/fuse/fuse-tegra.c:198:63: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *data @@     got void [noderef] __iomem *base @@
   drivers/soc/tegra/fuse/fuse-tegra.c:198:63: sparse:     expected void *data
   drivers/soc/tegra/fuse/fuse-tegra.c:198:63: sparse:     got void [noderef] __iomem *base

vim +188 drivers/soc/tegra/fuse/fuse-tegra.c

   184	
   185	static void tegra_fuse_restore(void *base)
   186	{
   187		fuse->clk = NULL;
 > 188		fuse->base = base;
   189	}
   190	
   191	static int tegra_fuse_probe(struct platform_device *pdev)
   192	{
   193		void __iomem *base = fuse->base;
   194		struct nvmem_config nvmem;
   195		struct resource *res;
   196		int err;
   197	
 > 198		err = devm_add_action(&pdev->dev, tegra_fuse_restore, base);
   199		if (err)
   200			return err;
   201	
   202		/* take over the memory region from the early initialization */
   203		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   204		fuse->phys = res->start;
   205		fuse->base = devm_ioremap_resource(&pdev->dev, res);
   206		if (IS_ERR(fuse->base)) {
   207			err = PTR_ERR(fuse->base);
   208			return err;
   209		}
   210	
   211		fuse->clk = devm_clk_get(&pdev->dev, "fuse");
   212		if (IS_ERR(fuse->clk)) {
   213			if (PTR_ERR(fuse->clk) != -EPROBE_DEFER)
   214				dev_err(&pdev->dev, "failed to get FUSE clock: %ld",
   215					PTR_ERR(fuse->clk));
   216	
   217			return PTR_ERR(fuse->clk);
   218		}
   219	
   220		platform_set_drvdata(pdev, fuse);
   221		fuse->dev = &pdev->dev;
   222	
   223		err = devm_pm_runtime_enable(&pdev->dev);
   224		if (err)
   225			return err;
   226	
   227		if (fuse->soc->probe) {
   228			err = fuse->soc->probe(fuse);
   229			if (err < 0)
   230				return err;
   231		}
   232	
   233		memset(&nvmem, 0, sizeof(nvmem));
   234		nvmem.dev = &pdev->dev;
   235		nvmem.name = "fuse";
   236		nvmem.id = -1;
   237		nvmem.owner = THIS_MODULE;
   238		nvmem.cells = tegra_fuse_cells;
   239		nvmem.ncells = ARRAY_SIZE(tegra_fuse_cells);
   240		nvmem.type = NVMEM_TYPE_OTP;
   241		nvmem.read_only = true;
   242		nvmem.root_only = true;
   243		nvmem.reg_read = tegra_fuse_read;
   244		nvmem.size = fuse->soc->info->size;
   245		nvmem.word_size = 4;
   246		nvmem.stride = 4;
   247		nvmem.priv = fuse;
   248	
   249		fuse->nvmem = devm_nvmem_register(&pdev->dev, &nvmem);
   250		if (IS_ERR(fuse->nvmem)) {
   251			err = PTR_ERR(fuse->nvmem);
   252			dev_err(&pdev->dev, "failed to register NVMEM device: %d\n",
   253				err);
   254			return err;
   255		}
   256	
   257		fuse->rst = devm_reset_control_get_optional(&pdev->dev, "fuse");
   258		if (IS_ERR(fuse->rst)) {
   259			err = PTR_ERR(fuse->rst);
   260			dev_err(&pdev->dev, "failed to get FUSE reset: %pe\n",
   261				fuse->rst);
   262			return err;
   263		}
   264	
   265		/*
   266		 * FUSE clock is enabled at a boot time, hence this resume/suspend
   267		 * disables the clock besides the h/w resetting.
   268		 */
   269		err = pm_runtime_resume_and_get(&pdev->dev);
   270		if (err)
   271			return err;
   272	
   273		err = reset_control_reset(fuse->rst);
   274		pm_runtime_put(&pdev->dev);
   275	
   276		if (err < 0) {
   277			dev_err(&pdev->dev, "failed to reset FUSE: %d\n", err);
   278			return err;
   279		}
   280	
   281		/* release the early I/O memory mapping */
   282		iounmap(base);
   283	
   284		return 0;
   285	}
   286	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux