[linux-next:master 4418/10906] drivers/firmware/tegra/bpmp.c:204:17: sparse: sparse: incorrect type in argument 2 (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:   6014cfa5bf32cf8c5c58b3cfd5ee0e1542c8a825
commit: a4740b148a04dc60e14fe6a1dfe216d3bae214fd [4418/10906] firmware: tegra: bpmp: Do only aligned access to IPC memory area
config: arm64-randconfig-s042-20220715 (https://download.01.org/0day-ci/archive/20220717/202207170050.xIhek5dO-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a4740b148a04dc60e14fe6a1dfe216d3bae214fd
        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 a4740b148a04dc60e14fe6a1dfe216d3bae214fd
        # 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=arm64 SHELL=/bin/bash arch/arm64/kernel/ drivers/firmware/tegra/ drivers/hid/

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


sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/tegra/bpmp.c:204:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const volatile [noderef] __iomem * @@     got unsigned char * @@
   drivers/firmware/tegra/bpmp.c:204:17: sparse:     expected void const volatile [noderef] __iomem *
   drivers/firmware/tegra/bpmp.c:204:17: sparse:     got unsigned char *
>> drivers/firmware/tegra/bpmp.c:248:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem * @@     got unsigned char * @@
   drivers/firmware/tegra/bpmp.c:248:17: sparse:     expected void volatile [noderef] __iomem *
   drivers/firmware/tegra/bpmp.c:248:17: sparse:     got unsigned char *
   drivers/firmware/tegra/bpmp.c:423:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem * @@     got unsigned char * @@
   drivers/firmware/tegra/bpmp.c:423:17: sparse:     expected void volatile [noderef] __iomem *
   drivers/firmware/tegra/bpmp.c:423:17: sparse:     got unsigned char *
   drivers/firmware/tegra/bpmp.c:505:53: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned int [usertype] mrq @@     got restricted __le32 [usertype] @@
   drivers/firmware/tegra/bpmp.c:505:53: sparse:     expected unsigned int [usertype] mrq
   drivers/firmware/tegra/bpmp.c:505:53: sparse:     got restricted __le32 [usertype]

vim +204 drivers/firmware/tegra/bpmp.c

   197	
   198	static ssize_t __tegra_bpmp_channel_read(struct tegra_bpmp_channel *channel,
   199						 void *data, size_t size, int *ret)
   200	{
   201		int err;
   202	
   203		if (data && size > 0)
 > 204			memcpy_fromio(data, channel->ib->data, size);
   205	
   206		err = tegra_bpmp_ack_response(channel);
   207		if (err < 0)
   208			return err;
   209	
   210		*ret = channel->ib->code;
   211	
   212		return 0;
   213	}
   214	
   215	static ssize_t tegra_bpmp_channel_read(struct tegra_bpmp_channel *channel,
   216					       void *data, size_t size, int *ret)
   217	{
   218		struct tegra_bpmp *bpmp = channel->bpmp;
   219		unsigned long flags;
   220		ssize_t err;
   221		int index;
   222	
   223		index = tegra_bpmp_channel_get_thread_index(channel);
   224		if (index < 0) {
   225			err = index;
   226			goto unlock;
   227		}
   228	
   229		spin_lock_irqsave(&bpmp->lock, flags);
   230		err = __tegra_bpmp_channel_read(channel, data, size, ret);
   231		clear_bit(index, bpmp->threaded.allocated);
   232		spin_unlock_irqrestore(&bpmp->lock, flags);
   233	
   234	unlock:
   235		up(&bpmp->threaded.lock);
   236	
   237		return err;
   238	}
   239	
   240	static ssize_t __tegra_bpmp_channel_write(struct tegra_bpmp_channel *channel,
   241						  unsigned int mrq, unsigned long flags,
   242						  const void *data, size_t size)
   243	{
   244		channel->ob->code = mrq;
   245		channel->ob->flags = flags;
   246	
   247		if (data && size > 0)
 > 248			memcpy_toio(channel->ob->data, data, size);
   249	
   250		return tegra_bpmp_post_request(channel);
   251	}
   252	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[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