diff options
author | Julien Grall <julien.grall@citrix.com> | 2015-06-17 15:28:03 +0100 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-06-17 16:15:10 +0100 |
commit | c9fd55eb6625ead6a1207e7da38026ff47c5198b (patch) | |
tree | 61c9a499a68bc1480a7e817e82239dc857578e16 /drivers/xen/xenbus/xenbus_client.c | |
parent | a9fd60e2683fb80f5b26a7d686aebe3327a63e70 (diff) | |
download | linux-c9fd55eb6625ead6a1207e7da38026ff47c5198b.tar.bz2 |
xen/xenbus: client: Fix call of virt_to_mfn in xenbus_grant_ring
virt_to_mfn should take a void* rather an unsigned long. While it
doesn't really matter now, it would throw a compiler warning later when
virt_to_mfn will enforce the type.
At the same time, avoid to compute new virtual address every time in the
loop and directly increment the parameter as we don't use it later.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/xenbus/xenbus_client.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index a014016eb7b0..9ad327238ba9 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -379,16 +379,16 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, int i, j; for (i = 0; i < nr_pages; i++) { - unsigned long addr = (unsigned long)vaddr + - (PAGE_SIZE * i); err = gnttab_grant_foreign_access(dev->otherend_id, - virt_to_mfn(addr), 0); + virt_to_mfn(vaddr), 0); if (err < 0) { xenbus_dev_fatal(dev, err, "granting access to ring page"); goto fail; } grefs[i] = err; + + vaddr = vaddr + PAGE_SIZE; } return 0; |