[vfs:work.iov_iter 18/25] drivers/xen/pvcalls-back.c:140:49: error: passing argument 3 of 'iov_iter_init' from incompatible pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.iov_iter
head:   5c0c5846f2cfd65908d8972d536303a425f57686
commit: 579e0f1d17ba8e8c241a1377c50810f23c54cb4c [18/25] xen: don't open-code iov_iter_init()
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 579e0f1d17ba8e8c241a1377c50810f23c54cb4c
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   drivers/xen/pvcalls-back.c: In function 'pvcalls_conn_back_read':
>> drivers/xen/pvcalls-back.c:140:49: error: passing argument 3 of 'iov_iter_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iov_iter_init(&msg.msg_iter, ITER_KVEC|WRITE, vec, 1, wanted);
                                                    ^~~
   In file included from include/linux/socket.h:7:0,
                    from include/net/flow.h:10,
                    from include/net/net_namespace.h:13,
                    from include/linux/inet.h:46,
                    from drivers/xen/pvcalls-back.c:15:
   include/linux/uio.h:169:6: note: expected 'const struct iovec *' but argument is of type 'struct kvec *'
    void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
         ^~~~~~~~~~~~~
   drivers/xen/pvcalls-back.c:146:49: error: passing argument 3 of 'iov_iter_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iov_iter_init(&msg.msg_iter, ITER_KVEC|WRITE, vec, 2, wanted);
                                                    ^~~
   In file included from include/linux/socket.h:7:0,
                    from include/net/flow.h:10,
                    from include/net/net_namespace.h:13,
                    from include/linux/inet.h:46,
                    from drivers/xen/pvcalls-back.c:15:
   include/linux/uio.h:169:6: note: expected 'const struct iovec *' but argument is of type 'struct kvec *'
    void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
         ^~~~~~~~~~~~~
   drivers/xen/pvcalls-back.c: In function 'pvcalls_conn_back_write':
   drivers/xen/pvcalls-back.c:198:48: error: passing argument 3 of 'iov_iter_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iov_iter_init(&msg.msg_iter, ITER_KVEC|READ, vec, 1, size);
                                                   ^~~
   In file included from include/linux/socket.h:7:0,
                    from include/net/flow.h:10,
                    from include/net/net_namespace.h:13,
                    from include/linux/inet.h:46,
                    from drivers/xen/pvcalls-back.c:15:
   include/linux/uio.h:169:6: note: expected 'const struct iovec *' but argument is of type 'struct kvec *'
    void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
         ^~~~~~~~~~~~~
   drivers/xen/pvcalls-back.c:204:48: error: passing argument 3 of 'iov_iter_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
      iov_iter_init(&msg.msg_iter, ITER_KVEC|READ, vec, 2, size);
                                                   ^~~
   In file included from include/linux/socket.h:7:0,
                    from include/net/flow.h:10,
                    from include/net/net_namespace.h:13,
                    from include/linux/inet.h:46,
                    from drivers/xen/pvcalls-back.c:15:
   include/linux/uio.h:169:6: note: expected 'const struct iovec *' but argument is of type 'struct kvec *'
    void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
         ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/iov_iter_init +140 drivers/xen/pvcalls-back.c

    93	
    94	static irqreturn_t pvcalls_back_conn_event(int irq, void *sock_map);
    95	static int pvcalls_back_release_active(struct xenbus_device *dev,
    96					       struct pvcalls_fedata *fedata,
    97					       struct sock_mapping *map);
    98	
    99	static void pvcalls_conn_back_read(void *opaque)
   100	{
   101		struct sock_mapping *map = (struct sock_mapping *)opaque;
   102		struct msghdr msg;
   103		struct kvec vec[2];
   104		RING_IDX cons, prod, size, wanted, array_size, masked_prod, masked_cons;
   105		int32_t error;
   106		struct pvcalls_data_intf *intf = map->ring;
   107		struct pvcalls_data *data = &map->data;
   108		unsigned long flags;
   109		int ret;
   110	
   111		array_size = XEN_FLEX_RING_SIZE(map->ring_order);
   112		cons = intf->in_cons;
   113		prod = intf->in_prod;
   114		error = intf->in_error;
   115		/* read the indexes first, then deal with the data */
   116		virt_mb();
   117	
   118		if (error)
   119			return;
   120	
   121		size = pvcalls_queued(prod, cons, array_size);
   122		if (size >= array_size)
   123			return;
   124		spin_lock_irqsave(&map->sock->sk->sk_receive_queue.lock, flags);
   125		if (skb_queue_empty(&map->sock->sk->sk_receive_queue)) {
   126			atomic_set(&map->read, 0);
   127			spin_unlock_irqrestore(&map->sock->sk->sk_receive_queue.lock,
   128					flags);
   129			return;
   130		}
   131		spin_unlock_irqrestore(&map->sock->sk->sk_receive_queue.lock, flags);
   132		wanted = array_size - size;
   133		masked_prod = pvcalls_mask(prod, array_size);
   134		masked_cons = pvcalls_mask(cons, array_size);
   135	
   136		memset(&msg, 0, sizeof(msg));
   137		if (masked_prod < masked_cons) {
   138			vec[0].iov_base = data->in + masked_prod;
   139			vec[0].iov_len = wanted;
 > 140			iov_iter_init(&msg.msg_iter, ITER_KVEC|WRITE, vec, 1, wanted);
   141		} else {
   142			vec[0].iov_base = data->in + masked_prod;
   143			vec[0].iov_len = array_size - masked_prod;
   144			vec[1].iov_base = data->in;
   145			vec[1].iov_len = wanted - vec[0].iov_len;
   146			iov_iter_init(&msg.msg_iter, ITER_KVEC|WRITE, vec, 2, wanted);
   147		}
   148	
   149		atomic_set(&map->read, 0);
   150		ret = inet_recvmsg(map->sock, &msg, wanted, MSG_DONTWAIT);
   151		WARN_ON(ret > wanted);
   152		if (ret == -EAGAIN) /* shouldn't happen */
   153			return;
   154		if (!ret)
   155			ret = -ENOTCONN;
   156		spin_lock_irqsave(&map->sock->sk->sk_receive_queue.lock, flags);
   157		if (ret > 0 && !skb_queue_empty(&map->sock->sk->sk_receive_queue))
   158			atomic_inc(&map->read);
   159		spin_unlock_irqrestore(&map->sock->sk->sk_receive_queue.lock, flags);
   160	
   161		/* write the data, then modify the indexes */
   162		virt_wmb();
   163		if (ret < 0)
   164			intf->in_error = ret;
   165		else
   166			intf->in_prod = prod + ret;
   167		/* update the indexes, then notify the other end */
   168		virt_wmb();
   169		notify_remote_via_irq(map->irq);
   170	
   171		return;
   172	}
   173	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux