Hi Jason,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    
https://github.com/0day-ci/linux/commits/Jason-Wang/Fix-various-issue-of-vhost/20181210-223236
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   include/linux/slab.h:332:43: warning: dubious: x & !y
   include/linux/slab.h:332:43: warning: dubious: x & !y
   include/linux/slab.h:332:43: warning: dubious: x & !y
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   include/linux/slab.h:332:43: warning: dubious: x & !y
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
>> drivers/vhost/vhost.c:1771:35: warning: cast removes address space '<asn:1>' 
>> of expression
   drivers/vhost/vhost.c:1776:42: warning: cast removes address space '<asn:1>' 
of expression
   drivers/vhost/vhost.c:1788:48: warning: cast removes address space '<asn:1>' 
of expression
   drivers/vhost/vhost.c:1819:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:1819:13:    expected void *addr
   drivers/vhost/vhost.c:1819:13:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:1837:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:1837:13:    expected void *addr
   drivers/vhost/vhost.c:1837:13:    got restricted __virtio16 [noderef] 
[usertype] <asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:1874:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:1874:13:    expected void *addr
   drivers/vhost/vhost.c:1874:13:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2073:21: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2073:21:    expected void *addr
   drivers/vhost/vhost.c:2073:21:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2100:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2100:13:    expected void *addr
   drivers/vhost/vhost.c:2100:13:    got restricted __virtio16 [noderef] 
<asn:1> *
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2231:21: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2231:21:    expected void *addr
   drivers/vhost/vhost.c:2231:21:    got restricted __virtio32 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2235:21: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2235:21:    expected void *addr
   drivers/vhost/vhost.c:2235:21:    got restricted __virtio32 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2281:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2281:13:    expected void *addr
   drivers/vhost/vhost.c:2281:13:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2315:21: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2315:21:    expected void *addr
   drivers/vhost/vhost.c:2315:21:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2329:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2329:13:    expected void *addr
   drivers/vhost/vhost.c:2329:13:    got restricted __virtio16 [noderef] 
[usertype] <asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr
   drivers/vhost/vhost.c:851:42:    got void *addr
   drivers/vhost/vhost.c:2374:13: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:2374:13:    expected void *addr
   drivers/vhost/vhost.c:2374:13:    got restricted __virtio16 [noderef] 
<asn:1> *<noident>
   drivers/vhost/vhost.c:704:17: warning: incorrect type in return expression 
(different address spaces)
   drivers/vhost/vhost.c:704:17:    expected void [noderef] <asn:1> *
   drivers/vhost/vhost.c:704:17:    got void *<noident>
   drivers/vhost/vhost.c:851:42: warning: incorrect type in argument 2 
(different address spaces)
   drivers/vhost/vhost.c:851:42:    expected void [noderef] <asn:1> *addr

vim +1771 drivers/vhost/vhost.c

  1760  
  1761  static void log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 
len)
  1762  {
  1763          struct iovec iov[64];
  1764          int i, ret;
  1765  
  1766          if (!vq->iotlb) {
  1767                  log_write(vq->log_base, vq->log_addr + used_offset, 
len);
  1768                  return;
  1769          }
  1770  
> 1771          ret = translate_desc(vq, (u64)vq->used + used_offset, len, iov, 
> 64,
  1772                               VHOST_ACCESS_WO);
  1773          WARN_ON(ret < 0);
  1774  
  1775          for (i = 0; i < ret; i++) {
  1776                  ret = log_write_hva(vq, (u64)iov[i].iov_base, 
iov[i].iov_len);
  1777                  WARN_ON(ret);
  1778          }
  1779  }
  1780  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to