diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-04-13 14:11:25 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-04-14 04:52:08 -0400 |
commit | a8d3782f9ea7574b8648e69bbb05a0b1d93e437e (patch) | |
tree | f21fa3d22453b5f701c49b2ed7f906f15bc63944 /drivers/vhost | |
parent | 179b284e2fc0c638035843968f7d7ab8ab701525 (diff) |
vhost: fix sparse warnings
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 4 | ||||
-rw-r--r-- | drivers/vhost/vhost.c | 11 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index a6a88dfd5029..38989d1335bc 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -641,7 +641,7 @@ static struct miscdevice vhost_net_misc = { | |||
641 | &vhost_net_fops, | 641 | &vhost_net_fops, |
642 | }; | 642 | }; |
643 | 643 | ||
644 | int vhost_net_init(void) | 644 | static int vhost_net_init(void) |
645 | { | 645 | { |
646 | int r = vhost_init(); | 646 | int r = vhost_init(); |
647 | if (r) | 647 | if (r) |
@@ -658,7 +658,7 @@ err_init: | |||
658 | } | 658 | } |
659 | module_init(vhost_net_init); | 659 | module_init(vhost_net_init); |
660 | 660 | ||
661 | void vhost_net_exit(void) | 661 | static void vhost_net_exit(void) |
662 | { | 662 | { |
663 | misc_deregister(&vhost_net_misc); | 663 | misc_deregister(&vhost_net_misc); |
664 | vhost_cleanup(); | 664 | vhost_cleanup(); |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index b8e112720812..3f101946b4f9 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -714,8 +714,8 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, | |||
714 | return 0; | 714 | return 0; |
715 | } | 715 | } |
716 | 716 | ||
717 | int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, | 717 | static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, |
718 | struct iovec iov[], int iov_size) | 718 | struct iovec iov[], int iov_size) |
719 | { | 719 | { |
720 | const struct vhost_memory_region *reg; | 720 | const struct vhost_memory_region *reg; |
721 | struct vhost_memory *mem; | 721 | struct vhost_memory *mem; |
@@ -740,7 +740,7 @@ int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, | |||
740 | _iov = iov + ret; | 740 | _iov = iov + ret; |
741 | size = reg->memory_size - addr + reg->guest_phys_addr; | 741 | size = reg->memory_size - addr + reg->guest_phys_addr; |
742 | _iov->iov_len = min((u64)len, size); | 742 | _iov->iov_len = min((u64)len, size); |
743 | _iov->iov_base = (void *)(unsigned long) | 743 | _iov->iov_base = (void __user *)(unsigned long) |
744 | (reg->userspace_addr + addr - reg->guest_phys_addr); | 744 | (reg->userspace_addr + addr - reg->guest_phys_addr); |
745 | s += size; | 745 | s += size; |
746 | addr += size; | 746 | addr += size; |
@@ -994,7 +994,7 @@ void vhost_discard_vq_desc(struct vhost_virtqueue *vq) | |||
994 | * want to notify the guest, using eventfd. */ | 994 | * want to notify the guest, using eventfd. */ |
995 | int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) | 995 | int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) |
996 | { | 996 | { |
997 | struct vring_used_elem *used; | 997 | struct vring_used_elem __user *used; |
998 | 998 | ||
999 | /* The virtqueue contains a ring of used buffers. Get a pointer to the | 999 | /* The virtqueue contains a ring of used buffers. Get a pointer to the |
1000 | * next entry in that used ring. */ | 1000 | * next entry in that used ring. */ |
@@ -1018,7 +1018,8 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) | |||
1018 | smp_wmb(); | 1018 | smp_wmb(); |
1019 | /* Log used ring entry write. */ | 1019 | /* Log used ring entry write. */ |
1020 | log_write(vq->log_base, | 1020 | log_write(vq->log_base, |
1021 | vq->log_addr + ((void *)used - (void *)vq->used), | 1021 | vq->log_addr + |
1022 | ((void __user *)used - (void __user *)vq->used), | ||
1022 | sizeof *used); | 1023 | sizeof *used); |
1023 | /* Log used index update. */ | 1024 | /* Log used index update. */ |
1024 | log_write(vq->log_base, | 1025 | log_write(vq->log_base, |