[linux-next:master 1162/7050] drivers/gpu/drm/tiny/ili9486.c:61:16: sparse: sparse: incorrect type in assignment (different base types)

[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:   b86a6a241b7c60ca7a6ca4fb3c0d2aedbbf2c1b6
commit: cdb702a655582e80139525156c57e6e48da08393 [1162/7050] drm/tiny: add support for tft displays based on ilitek,ili9486
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout cdb702a655582e80139525156c57e6e48da08393
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/tiny/ili9486.c:61:16: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   drivers/gpu/drm/tiny/ili9486.c:61:16: sparse:    expected unsigned short [usertype]
   drivers/gpu/drm/tiny/ili9486.c:61:16: sparse:    got restricted __be16 [usertype]
   drivers/gpu/drm/tiny/ili9486.c:71:32: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   drivers/gpu/drm/tiny/ili9486.c:71:32: sparse:    expected unsigned short [usertype]
   drivers/gpu/drm/tiny/ili9486.c:71:32: sparse:    got restricted __be16 [usertype]

vim +61 drivers/gpu/drm/tiny/ili9486.c

    35	
    36	/*
    37	 * The PiScreen/waveshare rpi-lcd-35 has a SPI to 16-bit parallel bus converter
    38	 * in front of the  display controller. This means that 8-bit values have to be
    39	 * transferred as 16-bit.
    40	 */
    41	static int waveshare_command(struct mipi_dbi *mipi, u8 *cmd, u8 *par,
    42				     size_t num)
    43	{
    44		struct spi_device *spi = mipi->spi;
    45		void *data = par;
    46		u32 speed_hz;
    47		int i, ret;
    48		u16 *buf;
    49	
    50		buf = kmalloc(32 * sizeof(u16), GFP_KERNEL);
    51		if (!buf)
    52			return -ENOMEM;
    53	
    54		/*
    55		 * The displays are Raspberry Pi HATs and connected to the 8-bit only
    56		 * SPI controller, so 16-bit command and parameters need byte swapping
    57		 * before being transferred as 8-bit on the big endian SPI bus.
    58		 * Pixel data bytes have already been swapped before this function is
    59		 * called.
    60		 */
  > 61		buf[0] = cpu_to_be16(*cmd);
    62		gpiod_set_value_cansleep(mipi->dc, 0);
    63		speed_hz = mipi_dbi_spi_cmd_max_speed(spi, 2);
    64		ret = mipi_dbi_spi_transfer(spi, speed_hz, 8, buf, 2);
    65		if (ret || !num)
    66			goto free;
    67	
    68		/* 8-bit configuration data, not 16-bit pixel data */
    69		if (num <= 32) {
    70			for (i = 0; i < num; i++)
    71				buf[i] = cpu_to_be16(par[i]);
    72			num *= 2;
    73			speed_hz = mipi_dbi_spi_cmd_max_speed(spi, num);
    74			data = buf;
    75		}
    76	
    77		gpiod_set_value_cansleep(mipi->dc, 1);
    78		ret = mipi_dbi_spi_transfer(spi, speed_hz, 8, data, num);
    79	 free:
    80		kfree(buf);
    81	
    82		return ret;
    83	}
    84	

---
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