Commit 72952cc0 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

vhost: add missing __user annotations

Several vhost functions were missing __user annotations
on pointers, causing sparse warnings. Fix this up.

sparse also warns about vhost_process_iotlb_msg which
is local and should be static. Fix that up as well.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 2f952c01
...@@ -719,7 +719,7 @@ static int memory_access_ok(struct vhost_dev *d, struct vhost_umem *umem, ...@@ -719,7 +719,7 @@ static int memory_access_ok(struct vhost_dev *d, struct vhost_umem *umem,
static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,
struct iovec iov[], int iov_size, int access); struct iovec iov[], int iov_size, int access);
static int vhost_copy_to_user(struct vhost_virtqueue *vq, void *to, static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to,
const void *from, unsigned size) const void *from, unsigned size)
{ {
int ret; int ret;
...@@ -749,7 +749,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void *to, ...@@ -749,7 +749,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void *to,
} }
static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to,
void *from, unsigned size) void __user *from, unsigned size)
{ {
int ret; int ret;
...@@ -783,7 +783,7 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, ...@@ -783,7 +783,7 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to,
} }
static void __user *__vhost_get_user(struct vhost_virtqueue *vq, static void __user *__vhost_get_user(struct vhost_virtqueue *vq,
void *addr, unsigned size) void __user *addr, unsigned size)
{ {
int ret; int ret;
...@@ -934,8 +934,8 @@ static int umem_access_ok(u64 uaddr, u64 size, int access) ...@@ -934,8 +934,8 @@ static int umem_access_ok(u64 uaddr, u64 size, int access)
return 0; return 0;
} }
int vhost_process_iotlb_msg(struct vhost_dev *dev, static int vhost_process_iotlb_msg(struct vhost_dev *dev,
struct vhost_iotlb_msg *msg) struct vhost_iotlb_msg *msg)
{ {
int ret = 0; int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment