提交 c9fd55eb 编写于 作者: J Julien Grall 提交者: David Vrabel

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: NJulien Grall <julien.grall@citrix.com>
Reviewed-by: NDavid 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: NDavid Vrabel <david.vrabel@citrix.com>
上级 a9fd60e2
...@@ -379,16 +379,16 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr, ...@@ -379,16 +379,16 @@ int xenbus_grant_ring(struct xenbus_device *dev, void *vaddr,
int i, j; int i, j;
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
unsigned long addr = (unsigned long)vaddr +
(PAGE_SIZE * i);
err = gnttab_grant_foreign_access(dev->otherend_id, err = gnttab_grant_foreign_access(dev->otherend_id,
virt_to_mfn(addr), 0); virt_to_mfn(vaddr), 0);
if (err < 0) { if (err < 0) {
xenbus_dev_fatal(dev, err, xenbus_dev_fatal(dev, err,
"granting access to ring page"); "granting access to ring page");
goto fail; goto fail;
} }
grefs[i] = err; grefs[i] = err;
vaddr = vaddr + PAGE_SIZE;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册