mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/spi/spi-armada-3700.c:500:65: sparse: sparse: incorrect type in argument 3 (different base types)
@ 2022-08-06  3:29 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-08-06  3:29 UTC (permalink / raw)
  To: Noam; +Cc: kbuild-all, linux-kernel, Mark Brown, Raz Adashi, Vadym Kochan

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6614a3c3164a5df2b54abb0b3559f51041cf705b
commit: 66bbf1441d218316948877f7ec6b477c9a49d554 spi: a3700: support BE for AC5 SPI driver
date:   11 days ago
config: arm64-randconfig-s052-20220804 (https://download.01.org/0day-ci/archive/20220806/202208061151.1zncglDW-lkp@intel.com/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/torvalds/linux.git/commit/?id=66bbf1441d218316948877f7ec6b477c9a49d554
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 66bbf1441d218316948877f7ec6b477c9a49d554
        # 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 drivers/block/null_blk/./ drivers/spi/ fs/zonefs/./

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

sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-armada-3700.c:500:65: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned int [usertype] data @@     got restricted __le32 [usertype] @@
   drivers/spi/spi-armada-3700.c:500:65: sparse:     expected unsigned int [usertype] data
   drivers/spi/spi-armada-3700.c:500:65: sparse:     got restricted __le32 [usertype]
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32
>> drivers/spi/spi-armada-3700.c:522:31: sparse: sparse: cast to restricted __le32

vim +500 drivers/spi/spi-armada-3700.c

   493	
   494	static int a3700_spi_fifo_write(struct a3700_spi *a3700_spi)
   495	{
   496		u32 val;
   497	
   498		while (!a3700_is_wfifo_full(a3700_spi) && a3700_spi->buf_len) {
   499			val = *(u32 *)a3700_spi->tx_buf;
 > 500			spireg_write(a3700_spi, A3700_SPI_DATA_OUT_REG, cpu_to_le32(val));
   501			a3700_spi->buf_len -= 4;
   502			a3700_spi->tx_buf += 4;
   503		}
   504	
   505		return 0;
   506	}
   507	
   508	static int a3700_is_rfifo_empty(struct a3700_spi *a3700_spi)
   509	{
   510		u32 val = spireg_read(a3700_spi, A3700_SPI_IF_CTRL_REG);
   511	
   512		return (val & A3700_SPI_RFIFO_EMPTY);
   513	}
   514	
   515	static int a3700_spi_fifo_read(struct a3700_spi *a3700_spi)
   516	{
   517		u32 val;
   518	
   519		while (!a3700_is_rfifo_empty(a3700_spi) && a3700_spi->buf_len) {
   520			val = spireg_read(a3700_spi, A3700_SPI_DATA_IN_REG);
   521			if (a3700_spi->buf_len >= 4) {
 > 522				val = le32_to_cpu(val);
   523				memcpy(a3700_spi->rx_buf, &val, 4);
   524	
   525				a3700_spi->buf_len -= 4;
   526				a3700_spi->rx_buf += 4;
   527			} else {
   528				/*
   529				 * When remain bytes is not larger than 4, we should
   530				 * avoid memory overwriting and just write the left rx
   531				 * buffer bytes.
   532				 */
   533				while (a3700_spi->buf_len) {
   534					*a3700_spi->rx_buf = val & 0xff;
   535					val >>= 8;
   536	
   537					a3700_spi->buf_len--;
   538					a3700_spi->rx_buf++;
   539				}
   540			}
   541		}
   542	
   543		return 0;
   544	}
   545	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-06  3:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-06  3:29 drivers/spi/spi-armada-3700.c:500:65: sparse: sparse: incorrect type in argument 3 (different base types) kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®