diff mbox

vhost-net patches

Message ID 20091023110438.GA20229@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael S. Tsirkin Oct. 23, 2009, 11:04 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 5b57697..9d856e9 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -286,11 +286,11 @@  static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
 			r = -EOPNOTSUPP;
 			break;
 		}
-		if ((u64)(long)a.user_addr != a.user_addr) {
+		if ((u64)(unsigned long)a.user_addr != a.user_addr) {
 			r = -EFAULT;
 			break;
 		}
-		vq->desc = (void __user *)(long)a.user_addr;
+		vq->desc = (void __user *)(unsigned long)a.user_addr;
 		break;
 	case VHOST_SET_VRING_AVAIL:
 		r = copy_from_user(&a, argp, sizeof a);
@@ -300,11 +300,11 @@  static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
 			r = -EOPNOTSUPP;
 			break;
 		}
-		if ((u64)(long)a.user_addr != a.user_addr) {
+		if ((u64)(unsigned long)a.user_addr != a.user_addr) {
 			r = -EFAULT;
 			break;
 		}
-		vq->avail = (void __user *)(long)a.user_addr;
+		vq->avail = (void __user *)(unsigned long)a.user_addr;
 		/* Forget the cached index value. */
 		vq->avail_idx = vq->last_avail_idx;
 		break;
@@ -316,11 +316,11 @@  static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
 			r = -EOPNOTSUPP;
 			break;
 		}
-		if ((u64)(long)a.user_addr != a.user_addr) {
+		if ((u64)(unsigned long)a.user_addr != a.user_addr) {
 			r = -EFAULT;
 			break;
 		}
-		vq->used = (void __user *)(long)a.user_addr;
+		vq->used = (void __user *)(unsigned long)a.user_addr;
 		r = init_used(vq);
 		if (r)
 			break;
@@ -389,7 +389,7 @@  static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
 
 	if (pollstop && vq->handle_kick)
 		vhost_poll_flush(&vq->poll);
-	return 0;
+	return r;
 }
 
 long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, unsigned long arg)