From: kernel test robot <lkp@intel.com>
To: Laurent Vivier <laurent@vivier.eu>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org,
virtualization@lists.linux-foundation.org,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH] virtio-mmio: read[wl]()/write[wl] are already little-endian
Date: Wed, 10 Mar 2021 11:08:21 +0800 [thread overview]
Message-ID: <202103101125.s4HrMQyc-lkp@intel.com> (raw)
In-Reply-To: <20210309224313.956065-1-laurent@vivier.eu>
[-- Attachment #1: Type: text/plain, Size: 5687 bytes --]
Hi Laurent,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.12-rc2 next-20210309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Laurent-Vivier/virtio-mmio-read-wl-write-wl-are-already-little-endian/20210310-064527
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32
config: x86_64-randconfig-s022-20210310 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
# https://github.com/0day-ci/linux/commit/1fd3d4da486545f554eb33663c6afe068bbcbcf8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Laurent-Vivier/virtio-mmio-read-wl-write-wl-are-already-little-endian/20210310-064527
git checkout 1fd3d4da486545f554eb33663c6afe068bbcbcf8
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/virtio/virtio_mmio.c:171:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] w @@ got unsigned short @@
drivers/virtio/virtio_mmio.c:171:19: sparse: expected restricted __le16 [usertype] w
drivers/virtio/virtio_mmio.c:171:19: sparse: got unsigned short
drivers/virtio/virtio_mmio.c:175:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] l @@ got unsigned int @@
drivers/virtio/virtio_mmio.c:175:19: sparse: expected restricted __le32 [usertype] l
drivers/virtio/virtio_mmio.c:175:19: sparse: got unsigned int
drivers/virtio/virtio_mmio.c:179:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [usertype] l @@ got unsigned int @@
drivers/virtio/virtio_mmio.c:179:19: sparse: expected restricted __le32 [addressable] [usertype] l
drivers/virtio/virtio_mmio.c:179:19: sparse: got unsigned int
drivers/virtio/virtio_mmio.c:181:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [addressable] [usertype] l @@ got unsigned int @@
drivers/virtio/virtio_mmio.c:181:19: sparse: expected restricted __le32 [addressable] [usertype] l
drivers/virtio/virtio_mmio.c:181:19: sparse: got unsigned int
>> drivers/virtio/virtio_mmio.c:215:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short val @@ got restricted __le16 [addressable] [usertype] w @@
drivers/virtio/virtio_mmio.c:215:24: sparse: expected unsigned short val
drivers/virtio/virtio_mmio.c:215:24: sparse: got restricted __le16 [addressable] [usertype] w
>> drivers/virtio/virtio_mmio.c:219:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le32 [addressable] [usertype] l @@
drivers/virtio/virtio_mmio.c:219:24: sparse: expected unsigned int val
drivers/virtio/virtio_mmio.c:219:24: sparse: got restricted __le32 [addressable] [usertype] l
drivers/virtio/virtio_mmio.c:223:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le32 [addressable] [usertype] l @@
drivers/virtio/virtio_mmio.c:223:24: sparse: expected unsigned int val
drivers/virtio/virtio_mmio.c:223:24: sparse: got restricted __le32 [addressable] [usertype] l
drivers/virtio/virtio_mmio.c:225:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __le32 [addressable] [usertype] l @@
drivers/virtio/virtio_mmio.c:225:24: sparse: expected unsigned int val
drivers/virtio/virtio_mmio.c:225:24: sparse: got restricted __le32 [addressable] [usertype] l
vim +215 drivers/virtio/virtio_mmio.c
188
189 static void vm_set(struct virtio_device *vdev, unsigned offset,
190 const void *buf, unsigned len)
191 {
192 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
193 void __iomem *base = vm_dev->base + VIRTIO_MMIO_CONFIG;
194 u8 b;
195 __le16 w;
196 __le32 l;
197
198 if (vm_dev->version == 1) {
199 const u8 *ptr = buf;
200 int i;
201
202 for (i = 0; i < len; i++)
203 writeb(ptr[i], base + offset + i);
204
205 return;
206 }
207
208 switch (len) {
209 case 1:
210 memcpy(&b, buf, sizeof b);
211 writeb(b, base + offset);
212 break;
213 case 2:
214 memcpy(&w, buf, sizeof w);
> 215 writew(w, base + offset);
216 break;
217 case 4:
218 memcpy(&l, buf, sizeof l);
> 219 writel(l, base + offset);
220 break;
221 case 8:
222 memcpy(&l, buf, sizeof l);
223 writel(l, base + offset);
224 memcpy(&l, buf + sizeof l, sizeof l);
225 writel(l, base + offset + sizeof l);
226 break;
227 default:
228 BUG();
229 }
230 }
231
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34366 bytes --]
next prev parent reply other threads:[~2021-03-10 3:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 22:43 Laurent Vivier
2021-03-10 3:08 ` kernel test robot [this message]
2021-03-11 15:44 ` Michael S. Tsirkin
2021-03-11 15:55 ` Laurent Vivier
2021-03-13 17:10 ` Laurent Vivier
2021-03-14 8:26 ` Michael S. Tsirkin
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=202103101125.s4HrMQyc-lkp@intel.com \
--to=lkp@intel.com \
--cc=jasowang@redhat.com \
--cc=kbuild-all@lists.01.org \
--cc=laurent@vivier.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.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
all inboxes | Powered by JetHome®