From: kbuild test robot <lkp@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 1162/7050] drivers/gpu/drm/tiny/ili9486.c:61:16: sparse: sparse: incorrect type in assignment (different base types)
Date: Sun, 8 Mar 2020 09:39:01 +0800 [thread overview]
Message-ID: <202003080959.opm2YjZv%lkp@intel.com> (raw)
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@intel.com>
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@lists.01.org
reply other threads:[~2020-03-08 1:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202003080959.opm2YjZv%lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox